Contents
- Description
- Nested Class Summary
- Field Summary
- Constructor Summary
- Method Summary
- Constructor Details
- Method Details
- register(K, Class, C)
- register(Priority, K, Class, C)
- remove(Class)
- getKey()
- getDefaultCodec()
- getCodecFor(K)
- getCodecFor(Class)
- getClassFor(K)
- getIdFor(Class)
- getRegisteredIds()
- decode(BsonValue, ExtraInfo)
- decodeAndInherit(BsonDocument, T, ExtraInfo)
- decodeAndInherit(BsonDocument, T, T, ExtraInfo)
- encode(T, ExtraInfo)
- decodeJson(RawJsonReader, ExtraInfo)
- decodeAndInheritJson(RawJsonReader, T, ExtraInfo)
- decodeAndInheritJson(RawJsonReader, T, T, ExtraInfo)
- validate(T, ExtraInfo)
- validateDefaults(ExtraInfo, Set)
- toSchema(SchemaContext)
Class ACodecMapCodec<K, T, C extends Codec<? extends T>>
java.lang.Object
com.hypixel.hytale.codec.lookup.ACodecMapCodec<K,T,C>
- All Implemented Interfaces:
Codec<T>, InheritCodec<T>, RawJsonCodec<T>, RawJsonInheritCodec<T>, SchemaConvertable<T>, ValidatableCodec<T>
- Direct Known Subclasses:
ObjectCodecMapCodec, StringCodecMapCodec
public abstract class ACodecMapCodec<K, T, C extends Codec<? extends T>>
extends Object
implements Codec<T>, ValidatableCodec<T>, InheritCodec<T>
- Since:
- 22/3/18
- Version:
- 1.0
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from interface Codec
BASE64_PATTERN, BOOLEAN, BSON_DOCUMENT, BYTE, BYTE_ARRAY, DOUBLE, DOUBLE_ARRAY, DURATION, DURATION_SECONDS, FLOAT, FLOAT_ARRAY, INSTANT, INT_ARRAY, INTEGER, LOG_LEVEL, LONG, LONG_ARRAY, NULLABLE_BOOLEAN, PATH, SHORT, STRING, STRING_ARRAY, UUID_BINARY, UUID_STRING -
Constructor Summary
ConstructorsConstructorDescriptionACodecMapCodec(Codec<K> keyCodec) ACodecMapCodec(Codec<K> keyCodec, boolean allowDefault) ACodecMapCodec(String id, Codec<K> keyCodec) ACodecMapCodec(String key, Codec<K> keyCodec, boolean allowDefault) ACodecMapCodec(String key, Codec<K> keyCodec, boolean allowDefault, boolean encodeDefaultKey) -
Method Summary
Modifier and TypeMethodDescriptiondecodeAndInherit(org.bson.BsonDocument document, T parent, ExtraInfo extraInfo) voiddecodeAndInherit(org.bson.BsonDocument document, T t, T parent, ExtraInfo extraInfo) decodeAndInheritJson(RawJsonReader reader, T parent, ExtraInfo extraInfo) voiddecodeAndInheritJson(RawJsonReader reader, T t, T parent, ExtraInfo extraInfo) decodeJson(RawJsonReader reader, ExtraInfo extraInfo) org.bson.BsonValuegetClassFor(K key) getCodecFor(Class<? extends T> key) getCodecFor(K key) getKey()voidtoSchema(SchemaContext context) Returns a schema object that represents this codec as JSON Schema.voidvoidvalidateDefaults(ExtraInfo extraInfo, Set<Codec<?>> tested) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RawJsonCodec
decodeJsonMethods inherited from interface SchemaConvertable
toSchema
-
Constructor Details
-
ACodecMapCodec
-
ACodecMapCodec
-
ACodecMapCodec
-
ACodecMapCodec
-
ACodecMapCodec
-
-
Method Details
-
register
-
register
-
remove
-
getKey
- Returns:
- the key that names the type of a value
-
getDefaultCodec
-
getCodecFor
-
getCodecFor
-
getClassFor
-
getIdFor
-
getRegisteredIds
-
decode
-
decodeAndInherit
@Nullable public T decodeAndInherit(@Nonnull org.bson.BsonDocument document, T parent, ExtraInfo extraInfo) - Specified by:
decodeAndInheritin interfaceInheritCodec<K>
-
decodeAndInherit
public void decodeAndInherit(@Nonnull org.bson.BsonDocument document, T t, T parent, ExtraInfo extraInfo) - Specified by:
decodeAndInheritin interfaceInheritCodec<K>
-
encode
-
decodeJson
@Nullable public T decodeJson(@Nonnull RawJsonReader reader, @Nonnull ExtraInfo extraInfo) throws IOException - Specified by:
decodeJsonin interfaceCodec<K>- Specified by:
decodeJsonin interfaceRawJsonCodec<K>- Throws:
IOException
-
decodeAndInheritJson
@Nullable public T decodeAndInheritJson(@Nonnull RawJsonReader reader, @Nullable T parent, @Nonnull ExtraInfo extraInfo) throws IOException - Specified by:
decodeAndInheritJsonin interfaceRawJsonInheritCodec<K>- Throws:
IOException
-
decodeAndInheritJson
public void decodeAndInheritJson(@Nonnull RawJsonReader reader, T t, @Nullable T parent, @Nonnull ExtraInfo extraInfo) throws IOException - Specified by:
decodeAndInheritJsonin interfaceRawJsonInheritCodec<K>- Throws:
IOException
-
validate
- Specified by:
validatein interfaceValidatableCodec<K>
-
validateDefaults
- Specified by:
validateDefaultsin interfaceValidatableCodec<K>
-
toSchema
Description copied from interface:SchemaConvertableReturns a schema object that represents this codec as JSON Schema.- Specified by:
toSchemain interfaceSchemaConvertable<K>- Parameters:
context- A context to use to assist with creating the schema.- Returns:
- the generated schema.
-