- 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
public class InsertElement extends ListUpdate
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
Fields Modifier and Type Field Description static StringINSERT_ELEMENT__TYPEIdentifier for theInsertElementtype in JSON format.
-
Constructor Summary
Constructors Modifier Constructor Description protectedInsertElement()Creates aInsertElementinstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static InsertElementcreate()Creates aInsertElementinstance.ObjectgetElement()Cache for the actual value that was inserted to the givenListUpdate.getIndex().booleanhasElement()Checks, whethergetElement()has a value.protected voidinternalSetElement(Object value)Internal setter forgetElement()without chain call utility.StringjsonType()The type identifier for this concrete subtype.Command.TypeKindkind()The type code of this instance.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 InsertElementreadInsertElement(DataReader in)Reads a new instance from the given reader.static InsertElementreadInsertElement(JsonReader in)Reads a new instance from the given reader.static InsertElementreadInsertElement_Content(DataReader in)Helper for creating an object of typeInsertElementfrom a polymorphic composition.InsertElementsetElement(Object value)InsertElementsetId(int value)InsertElementsetIndex(int value)InsertElementsetNext(ListUpdate value)InsertElementsetNode(SharedGraphNode value)InsertElementsetProperty(String value)inttypeId()The binary identifier for this concrete type in the polymorphicInsertElementhierarchy.<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, internalSetIndex, internalSetNext, readListUpdate, readListUpdate, visit
-
Methods inherited from class de.haumacher.msgbuf.graph.cmd.Command
getId, getNode, getProperty, hasNode, internalSetId, internalSetNode, internalSetProperty, readCommand, readCommand, readContent, writeTo, writeTo
-
Methods inherited from class de.haumacher.msgbuf.data.AbstractDataObject
readContent, readFields, toString, writeContent
-
-
-
-
Field Detail
-
INSERT_ELEMENT__TYPE
public static final String INSERT_ELEMENT__TYPE
Identifier for theInsertElementtype in JSON format.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
InsertElement
protected InsertElement()
Creates aInsertElementinstance.- See Also:
create()
-
-
Method Detail
-
create
public static InsertElement create()
Creates aInsertElementinstance.
-
kind
public Command.TypeKind kind()
Description copied from class:CommandThe type code of this instance.
-
getElement
public final Object getElement()
Cache for the actual value that was inserted to the givenListUpdate.getIndex().
-
setElement
public InsertElement setElement(Object value)
- See Also:
getElement()
-
internalSetElement
protected final void internalSetElement(Object value)
Internal setter forgetElement()without chain call utility.
-
hasElement
public final boolean hasElement()
Checks, whethergetElement()has a value.
-
setIndex
public InsertElement setIndex(int value)
- Overrides:
setIndexin classListUpdate- See Also:
ListUpdate.getIndex()
-
setNext
public InsertElement setNext(ListUpdate value)
- Overrides:
setNextin classListUpdate- See Also:
ListUpdate.getNext()
-
setId
public InsertElement setId(int value)
- Overrides:
setIdin classListUpdate- See Also:
Command.getId()
-
setProperty
public InsertElement setProperty(String value)
- Overrides:
setPropertyin classListUpdate- See Also:
Command.getProperty()
-
setNode
public InsertElement setNode(SharedGraphNode value)
- Overrides:
setNodein classListUpdate- See Also:
Command.getNode()
-
jsonType
public String jsonType()
Description copied from class:CommandThe type identifier for this concrete subtype.
-
readInsertElement
public static InsertElement readInsertElement(JsonReader in) throws IOException
Reads a new instance from the given reader.- Throws:
IOException
-
writeFields
protected void writeFields(JsonWriter out) throws IOException
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
protected void readField(JsonReader in, String field) throws IOException
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()
The binary identifier for this concrete type in the polymorphicInsertElementhierarchy.
-
writeFields
protected void writeFields(DataWriter out) throws IOException
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
public static InsertElement readInsertElement(DataReader in) throws IOException
Reads a new instance from the given reader.- Throws:
IOException
-
readInsertElement_Content
public static InsertElement readInsertElement_Content(DataReader in) throws IOException
Helper for creating an object of typeInsertElementfrom a polymorphic composition.- Throws:
IOException
-
readField
protected void readField(DataReader in, int field) throws IOException
Description copied from class:CommandConsumes the value for the field with the given ID and assigns its value.- Overrides:
readFieldin classListUpdate- Throws:
IOException
-
visit
public <R,A,E extends Throwable> R visit(ListUpdate.Visitor<R,A,E> v, A arg) throws E extends Throwable
Description copied from class:ListUpdateAccepts the given visitor.- Specified by:
visitin classListUpdate- Throws:
E extends Throwable
-
-