V - value typepublic abstract class TypedKey<V> extends Object
Usage: construct final anonymous subclasses in interfaces.
public interface Solos {
TypedKey<String> PasssaltByUid = new TypedKey<String>() {};
TypedKey<Set<String>> PermitsByUid = new TypedKey<Set<String>>() {};
}
| Modifier and Type | Field and Description |
|---|---|
@NotNull Class<? extends TypedKey<V>> |
regType |
@NotNull Type |
valType |
| Modifier | Constructor and Description |
|---|---|
protected |
TypedKey() |
| Modifier and Type | Method and Description |
|---|---|
static <K> @NotNull TypedKey<K> |
deserialize(@NotNull String clz)
deserialize to singleton instance
|
static <K> TypedKey<K> |
deserialize(@NotNull String clz,
boolean nonnull)
deserialize to singleton instance
|
boolean |
equals(Object o) |
V |
get(@NotNull Function<TypedKey<V>,V> fun,
boolean nonnull) |
V |
get(@NotNull Map<TypedKey<V>,? extends V> map,
boolean nonnull) |
V |
getOr(@NotNull Function<TypedKey<V>,V> fun,
V elze) |
V |
getOr(@NotNull Map<TypedKey<V>,? extends V> map,
V elze) |
int |
hashCode() |
@NotNull String |
serialize()
serialize to string
|
void |
set(@NotNull BiConsumer<TypedKey<V>,V> fun,
V value) |
void |
set(@NotNull Map<TypedKey<V>,? super V> map,
V value) |
String |
toString() |
V |
tryOr(@NotNull Function<TypedKey<V>,?> fun,
V elze) |
V |
tryOr(@NotNull Map<?,?> map,
V elze) |
@NotNull public final @NotNull Type valType
public void set(@NotNull
@NotNull BiConsumer<TypedKey<V>,V> fun,
V value)
@Contract(value="_,true->!null") public V get(@NotNull @NotNull Function<TypedKey<V>,V> fun, boolean nonnull)
@Contract(value="_,true->!null") public V get(@NotNull @NotNull Map<TypedKey<V>,? extends V> map, boolean nonnull)
@Contract(value="_,!null ->!null") public V getOr(@NotNull @NotNull Function<TypedKey<V>,V> fun, V elze)
@Contract(value="_,!null ->!null") public V getOr(@NotNull @NotNull Map<TypedKey<V>,? extends V> map, V elze)
@Contract(value="_,!null ->!null") public V tryOr(@NotNull @NotNull Function<TypedKey<V>,?> fun, V elze) throws ClassCastException
ClassCastException@Contract(value="_,!null ->!null") public V tryOr(@NotNull @NotNull Map<?,?> map, V elze) throws ClassCastException
ClassCastException@NotNull public @NotNull String serialize()
@NotNull public static <K> @NotNull TypedKey<K> deserialize(@NotNull @NotNull String clz)
Copyright © 2025. All rights reserved.