Package com.hypixel.hytale.codec.lookup
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>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final recordstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final booleanprotected AtomicReference<ACodecMapCodec.CodecPriority<C>[]> protected final booleanprotected final StringFields inherited from interface com.hypixel.hytale.codec.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, 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) protected voidmutateChildSchema(String key, SchemaContext context, BuilderCodec<? extends T> c, ObjectSchema objectSchema) voidtoSchema(SchemaContext context) voidvoidvalidateDefaults(ExtraInfo extraInfo, Set<Codec<?>> tested) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.hypixel.hytale.codec.RawJsonCodec
decodeJsonMethods inherited from interface com.hypixel.hytale.codec.schema.SchemaConvertable
toSchema
-
Field Details
-
key
-
keyCodec
-
idToCodec
-
classToId
-
idToClass
-
codecs
@Nonnull protected AtomicReference<ACodecMapCodec.CodecPriority<C extends Codec<? extends T>>[]> codecs -
allowDefault
protected final boolean allowDefault -
encodeDefaultKey
protected final boolean encodeDefaultKey
-
-
Constructor Details
-
ACodecMapCodec
-
ACodecMapCodec
-
ACodecMapCodec
-
ACodecMapCodec
-
ACodecMapCodec
-
-
Method Details
-
register
-
register
-
remove
-
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
- Specified by:
toSchemain interfaceSchemaConvertable<K>
-
mutateChildSchema
protected void mutateChildSchema(String key, @Nonnull SchemaContext context, BuilderCodec<? extends T> c, @Nonnull ObjectSchema objectSchema)
-