V - The serialized value type.public final class MapSerializableType<V> extends ParameterizedSerializableType<Map<String,V>>
SerializableType for mappings from String keys to some value type.| Constructor and Description |
|---|
MapSerializableType(SerializableType<V> valueType) |
MapSerializableType(StringSerializableType keyType,
SerializableType<V> valueType) |
MapSerializableType(StringSerializableType keyType,
SerializableType<V> valueType,
int minSize,
int maxSize) |
| Modifier and Type | Method and Description |
|---|---|
Map<String,V> |
cast(Object value)
Casts an object to the type represented by this type.
|
<S> Map<String,V> |
deserializeValue(S elem,
ValueSerializer<S,?> serializer)
Deserializes a config primitive from a serialized form.
|
boolean |
equals(Object o)
Two serialized types are equal if and only if they are of the same kind
and both have the same constraints.
|
StringSerializableType |
getKeyType() |
int |
getMaxSize() |
int |
getMinSize() |
ParameterizedType |
getParameterizedType()
The
ParameterizedType used to represent values of this type. |
SerializableType<V> |
getValueType() |
int |
hashCode() |
<S> void |
serialize(TypeSerializer<S> serializer,
S target)
Serializes this type to a persistent format using the given
TypeSerializer. |
<S> S |
serializeValue(Map<String,V> value,
ValueSerializer<S,?> serializer)
Serializes a config primitive to a serialized form.
|
String |
toString() |
getGenericPlatformTypeaccepts, getErasedPlatformType, isAssignableFrom, testpublic MapSerializableType(SerializableType<V> valueType)
public MapSerializableType(StringSerializableType keyType, SerializableType<V> valueType)
public MapSerializableType(StringSerializableType keyType, SerializableType<V> valueType, int minSize, int maxSize)
public StringSerializableType getKeyType()
public SerializableType<V> getValueType()
public int getMinSize()
public int getMaxSize()
public ParameterizedType getParameterizedType()
ParameterizedSerializableTypeParameterizedType used to represent values of this type.getParameterizedType in class ParameterizedSerializableType<Map<String,V>>public Map<String,V> cast(@Nonnull Object value)
SerializableTypeThis method does not check the value against this type's constraints. For parameterized types, this method may inspect the object and thus not run in constant time.
cast in class SerializableType<Map<String,V>>value - The value.public <S> void serialize(TypeSerializer<S> serializer, S target)
SerializableTypeTypeSerializer.serialize in class SerializableType<Map<String,V>>S - The type to serialize to.serializer - The type serializer to use.target - The place to which this type is serialized.TypeSerializerpublic <S> S serializeValue(Map<String,V> value, ValueSerializer<S,?> serializer)
SerializableTypeSerializableType.cast(Object) and additionally
satisfy this type's particular constraints.serializeValue in class SerializableType<Map<String,V>>S - The type of the serialized form.value - The value to serialize.serializer - A ValueSerializer defining the serialized form.public <S> Map<String,V> deserializeValue(S elem, ValueSerializer<S,?> serializer) throws ValueDeserializationException
SerializableTypedeserializeValue in class SerializableType<Map<String,V>>S - The type of the serialized form.elem - The serialized form of the value.serializer - A ValueSerializer defining the serialized form.ValueDeserializationException - If a value cannot be deserialized.public boolean equals(Object o)
SerializableTypeequals in class SerializableType<Map<String,V>>public int hashCode()
hashCode in class SerializableType<Map<String,V>>