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 Map<?,?> map) |
V |
getOr(@NotNull Map<?,?> map,
V elze) |
int |
hashCode() |
@NotNull String |
serialize()
serialize to string
|
String |
toString() |
V |
tryOr(@Nullable Object obj,
V elze) |
@NotNull public final @NotNull Type valType
@Nullable public V get(@NotNull @NotNull Map<?,?> map) throws ClassCastException
ClassCastException@Contract(value="_,!null ->!null") public V getOr(@NotNull @NotNull Map<?,?> map, V elze) throws ClassCastException
ClassCastException@Contract(value="_,!null ->!null") public V tryOr(@Nullable @Nullable Object obj, V elze) throws ClassCastException
ClassCastException@NotNull public @NotNull String serialize()
@NotNull public static <K> @NotNull TypedKey<K> deserialize(@NotNull @NotNull String clz)
Copyright © 2024. All rights reserved.