ITuple2.Base<T1,T2>
Constructor and Description |
---|
Entry() |
Modifier and Type | Method and Description |
---|---|
EK |
_1()
Get the first element.
|
EV |
_2()
Get the second element.
|
boolean |
equals(java.lang.Object o) |
abstract EK |
getKey()
Get the key.
|
EV |
getNonNullValue()
Get the value, but make sure it is not
null . |
abstract EV |
getValue()
Get the value.
|
EV |
getValueOrDefault(EV defaultValue)
Get the value, or a default.
|
int |
hashCode() |
<NEK> Dict.Entry<NEK,EV> |
keyView(java.util.function.Function<? super EK,? extends NEK> keyMapper)
View this entry as if it has another key.
|
java.lang.String |
toString() |
<NEV> Dict.Entry<EK,NEV> |
valueView(java.util.function.Function<? super EV,? extends NEV> valueMapper)
View this entry as if it has a different value type.
|
static <KT,VT> Dict.Entry<KT,VT> |
view(KT key,
VT value)
View a pair of key and value as an entry.
|
static <MEK,MEV> Dict.Entry<MEK,MEV> |
viewMapEntry(java.util.Map.Entry<? extends MEK,? extends MEV> mapEntry) |
<NEK,NEV> Dict.Entry<NEK,NEV> |
viewMapped(java.util.function.Function<? super EK,? extends NEK> keyMapper,
java.util.function.Function<? super EV,? extends NEV> valueMapper)
View this entry as if it has a different value.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
_21, asBase, concat1, concat2, concat3, concat4, concat5, concat6, concat7, concat8, concatPred1, concatPred2, concatPred3, concatPred4, concatPred5, concatPred6, concatPred7, concatPred8, concatProc1, concatProc2, concatProc3, concatProc4, concatProc5, concatProc6, concatProc7, concatProc8, equals, frozen, frozenNotNull, hash, invoke, sendTo, testBy, toString, toString
public abstract EK getKey()
public abstract EV getValue()
@NotNull public EV getNonNullValue()
null
.
Depending on the underlying mapping null
values might be acceptable, but will result in an exception
nevertheless.java.lang.NullPointerException
- if the return value would have been null
getValueOrDefault(Object)
@NotNull public EV getValueOrDefault(@NotNull EV defaultValue)
null
.defaultValue
- default value used as fallbackdefaultValue
@NotNull public <NEK> Dict.Entry<NEK,EV> keyView(@NotNull java.util.function.Function<? super EK,? extends NEK> keyMapper)
NEK
- new key typekeyMapper
- mapper from internal key to expected key@NotNull public <NEV> Dict.Entry<EK,NEV> valueView(@NotNull java.util.function.Function<? super EV,? extends NEV> valueMapper)
NEV
- new value typevalueMapper
- mapper from internal to expected value@NotNull public <NEK,NEV> Dict.Entry<NEK,NEV> viewMapped(@NotNull java.util.function.Function<? super EK,? extends NEK> keyMapper, @NotNull java.util.function.Function<? super EV,? extends NEV> valueMapper)
NEK
- returned key typeNEV
- returned value typekeyMapper
- mapper from internal to expected key typevalueMapper
- mapper from internal to expected value type@NotNull public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@NotNull public static <KT,VT> Dict.Entry<KT,VT> view(KT key, @NotNull VT value)
@NotNull public static <MEK,MEV> Dict.Entry<MEK,MEV> viewMapEntry(@NotNull java.util.Map.Entry<? extends MEK,? extends MEV> mapEntry)