Package alexiil.mc.lib.net
Class ParentNetIdSingle<T>
java.lang.Object
alexiil.mc.lib.net.TreeNetIdBase
alexiil.mc.lib.net.ParentNetIdBase
alexiil.mc.lib.net.ParentNetIdSingle<T>
- Type Parameters:
T
- The type of object that will be written and read. This must not have any generic type parameters itself: as it must be representable with aClass
.
- Direct Known Subclasses:
DynamicNetId
,ParentNetIdDuel
A
parent node
that writes out the context for the receiver to obtain the same object.-
Field Summary
Fields inherited from class alexiil.mc.lib.net.TreeNetIdBase
DYNAMIC_LENGTH, fullName, length, name, parent, totalLength
-
Constructor Summary
ConstructorDescriptionParentNetIdSingle(ParentNetId parent, Class<T> clazz, String name, int thisLength)
-
Method Summary
Modifier and TypeMethodDescription<U> ParentNetIdExtractor<T,U>
protected String
protected abstract T
readContext(NetByteBuf buffer, IMsgReadCtx ctx)
readKey(CheckingNetByteBuf buffer, IMsgReadCtx ctx)
<U extends T>
ParentNetIdCast<T,U>protected abstract void
writeContext(NetByteBuf buffer, IMsgWriteCtx ctx, T value)
protected void
writeDynamicContext(CheckingNetByteBuf buffer, IMsgWriteCtx ctx, T value, List<TreeNetIdBase> resolvedPath)
void
writeKey(CheckingNetByteBuf buffer, IMsgWriteCtx ctx, T value)
Methods inherited from class alexiil.mc.lib.net.TreeNetIdBase
equals, getRealClassName, hasFixedLength, hashCode, toString
-
Field Details
-
clazz
The type of the object to be written and read.
-
-
Constructor Details
-
ParentNetIdSingle
- Parameters:
clazz
- The type of the object to be written and read.
-
-
Method Details
-
getPrintableName
- Overrides:
getPrintableName
in classTreeNetIdBase
-
idData
-
idData
-
idSignal
-
subType
-
extractor
-
child
-
readContext
protected abstract T readContext(NetByteBuf buffer, IMsgReadCtx ctx) throws InvalidInputDataException- Returns:
- The read value, or null if the parent couldn't be read.
- Throws:
InvalidInputDataException
- if the byte buffer contained invalid data.
-
writeContext
-
writeDynamicContext
protected void writeDynamicContext(CheckingNetByteBuf buffer, IMsgWriteCtx ctx, T value, List<TreeNetIdBase> resolvedPath) -
writeKey
-
readKey
public final T readKey(CheckingNetByteBuf buffer, IMsgReadCtx ctx) throws InvalidInputDataException- Throws:
InvalidInputDataException
-