Class DecoderRegistry<W,M>
java.lang.Object
dev.wyck.wrapper.decode.DecoderRegistry<W,M>
- Type Parameters:
W- the family this registry decodesM- the Minecraft type dispatched by this registry
- All Implemented Interfaces:
Decodable<W,M>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal WDecodes a Minecraft value into the Wyck type owned by this decoder.protected abstract ResourceKeydiscriminate(M minecraftObject) Gets the key that identifies the concrete type of a Minecraft object.protected Stringfamily()final Set<ResourceKey> handled()Gets every type key claimed by this registry.final booleanhandles(ResourceKey type) protected MRewrites an object into the form this registry's decoders expect.protected final voidregister(ResourceKey key, Function<M, W> decoder) Registers an inline decoder under an explicit key, including family-defined pseudo-types.protected final voidprotected final voidRegisters a decoder for a single vanilla type.final ResourceKey
-
Constructor Details
-
DecoderRegistry
protected DecoderRegistry()
-
-
Method Details
-
discriminate
Gets the key that identifies the concrete type of a Minecraft object.- Parameters:
minecraftObject- the Minecraft object to discriminate- Returns:
- the object's decoder type key
-
normalize
-
register
-
register
Registers an inline decoder under an explicit key, including family-defined pseudo-types.- Parameters:
key- the type key handled by the decoderdecoder- the decoder function
-
register
-
decode
-
typeOf
-
handles
-
handled
Gets every type key claimed by this registry.- Returns:
- the handled type keys
-
family
-