Package alexiil.mc.lib.net
Class NetKeyMapper<T>
java.lang.Object
alexiil.mc.lib.net.NetKeyMapper<T>
- Direct Known Subclasses:
NetKeyMapper.OfEnum
,NetKeyMapper.ToString
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
NetKeyMapper.OfEnum<E extends Enum<E>>
static class
-
Field Summary
Modifier and TypeFieldDescriptionint
The known length in bytes of this key, orLENGTH_DYNAMIC
if this isn't a constant.static int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract T
read(NetByteBuf buffer, IMsgReadCtx ctx)
Reads the value for the key from the buffer, optionally using the parent keys.abstract void
write(NetByteBuf buffer, IMsgWriteCtx ctx, T value)
-
Field Details
-
LENGTH_DYNAMIC
public static final int LENGTH_DYNAMIC- See Also:
- Constant Field Values
-
clazz
-
length
public final int lengthThe known length in bytes of this key, orLENGTH_DYNAMIC
if this isn't a constant.
-
-
Constructor Details
-
NetKeyMapper
-
NetKeyMapper
-
-
Method Details
-
read
Reads the value for the key from the buffer, optionally using the parent keys.Note that any of the parent keys might be null if they failed to read!
- Returns:
- null if the key couldn't be found in whatever context this requires.
- Throws:
InvalidInputDataException
-
write
-