java.lang.Object
de.haumacher.msgbuf.data.AbstractDataObject
de.haumacher.msgbuf.graph.cmd.Command
de.haumacher.msgbuf.graph.cmd.ListUpdate
de.haumacher.msgbuf.graph.cmd.InsertElement
- All Implemented Interfaces:
BinaryDataObject,DataObject,ReflectiveDataObject,Observable
An insert operation to a list value.
-
Nested Class Summary
Nested classes/interfaces inherited from class de.haumacher.msgbuf.graph.cmd.ListUpdate
ListUpdate.Visitor<R,A, E extends Throwable> Nested classes/interfaces inherited from class de.haumacher.msgbuf.graph.cmd.Command
Command.TypeKind -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringIdentifier for theInsertElementtype in JSON format.static final intIdentifier for theInsertElementtype in binary format.Fields inherited from class de.haumacher.msgbuf.graph.cmd.ListUpdate
INDEX, INDEX__ID, NEXT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic InsertElementcreate()Creates aInsertElementinstance.Retrieves value of the field with the given name.final ObjectCache for the actual value that was inserted to the givenListUpdate.getIndex().final booleanChecks, whethergetElement()has a value.jsonType()The type identifier for this concrete sub-type.kind()The type code of this instance.All properties that are supported by this object.protected voidreadField(DataReader in, int field) Consumes the value for the field with the given ID and assigns its value.protected voidreadField(JsonReader in, String field) Reads the given field from the given input.static InsertElementReads a new instance from the given reader.static InsertElementReads a new instance from the given reader.voidSets the value of the property with the given name.final InsertElementsetElement(Object value) inttypeId()The binary identifier for this concrete type in the polymorphicCommandhierarchy.<R,A, E extends Throwable>
Rvisit(ListUpdate.Visitor<R, A, E> v, A arg) Accepts the given visitor.protected voidwriteFields(DataWriter out) Serializes all fields of this instance to the given binary output.protected voidwriteFields(JsonWriter out) Writes all fields of this instance to the given output.Methods inherited from class de.haumacher.msgbuf.graph.cmd.ListUpdate
getIndex, getNext, hasNext, readListUpdate, readListUpdate, setIndex, setNext, visitMethods inherited from class de.haumacher.msgbuf.graph.cmd.Command
getId, getNode, getProperty, hasNode, readCommand, readCommand, registerListener, setId, setNode, setProperty, unregisterListener, writeTo, writeToMethods inherited from class de.haumacher.msgbuf.data.AbstractDataObject
readContent, readFields, toString, writeContent
-
Field Details
-
INSERT_ELEMENT__TYPE
Identifier for theInsertElementtype in JSON format.- See Also:
-
ELEMENT
- See Also:
-
INSERT_ELEMENT__TYPE_ID
public static final int INSERT_ELEMENT__TYPE_IDIdentifier for theInsertElementtype in binary format.- See Also:
-
-
Constructor Details
-
InsertElement
protected InsertElement()Creates aInsertElementinstance.- See Also:
-
-
Method Details
-
create
Creates aInsertElementinstance. -
kind
Description copied from class:CommandThe type code of this instance. -
getElement
Cache for the actual value that was inserted to the givenListUpdate.getIndex(). -
setElement
- See Also:
-
hasElement
public final boolean hasElement()Checks, whethergetElement()has a value. -
jsonType
Description copied from interface:ReflectiveDataObjectThe type identifier for this concrete sub-type. -
properties
Description copied from interface:ReflectiveDataObjectAll properties that are supported by this object.- Specified by:
propertiesin interfaceReflectiveDataObject- Overrides:
propertiesin classListUpdate- See Also:
-
get
Description copied from interface:ReflectiveDataObjectRetrieves value of the field with the given name.- Specified by:
getin interfaceReflectiveDataObject- Overrides:
getin classListUpdate- Parameters:
field- The name of the property.- Returns:
- The value of the property with the given name.
- See Also:
-
set
Description copied from interface:ReflectiveDataObjectSets the value of the property with the given name.- Specified by:
setin interfaceReflectiveDataObject- Overrides:
setin classListUpdate- Parameters:
field- The name of the property to update.value- The new value of the property.- See Also:
-
readInsertElement
Reads a new instance from the given reader.- Throws:
IOException
-
writeFields
Description copied from class:AbstractDataObjectWrites all fields of this instance to the given output.- Overrides:
writeFieldsin classListUpdate- Parameters:
out- The writer to write to.- Throws:
IOException- If writing fails.
-
readField
Description copied from class:AbstractDataObjectReads the given field from the given input.- Overrides:
readFieldin classListUpdate- Parameters:
in- The reader to take the value from.field- The name of the field whose value should be read.- Throws:
IOException
-
typeId
public int typeId()Description copied from class:CommandThe binary identifier for this concrete type in the polymorphicCommandhierarchy. -
writeFields
Description copied from class:CommandSerializes all fields of this instance to the given binary output.- Overrides:
writeFieldsin classListUpdate- Parameters:
out- The binary output to write to.- Throws:
IOException- If writing fails.
-
readInsertElement
Reads a new instance from the given reader.- Throws:
IOException
-
readField
Description copied from class:CommandConsumes the value for the field with the given ID and assigns its value.- Overrides:
readFieldin classListUpdate- Throws:
IOException
-
visit
Description copied from class:ListUpdateAccepts the given visitor.- Specified by:
visitin classListUpdate- Throws:
E extends Throwable
-