- java.lang.Object
-
- de.haumacher.msgbuf.data.AbstractDataObject
-
- de.haumacher.msgbuf.graph.cmd.Command
-
- de.haumacher.msgbuf.graph.cmd.ListUpdate
-
- All Implemented Interfaces:
BinaryDataObject,DataObject
- Direct Known Subclasses:
InsertElement,RemoveElement
public abstract class ListUpdate extends Command
Base class for operations internally changing the values of repeated properties.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceListUpdate.Visitor<R,A,E extends Throwable>Visitor interface for theListUpdatehierarchy.-
Nested classes/interfaces inherited from class de.haumacher.msgbuf.graph.cmd.Command
Command.TypeKind
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedListUpdate()Creates aListUpdateinstance.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description intgetIndex()The list index that is modified.ListUpdategetNext()Pointer to chain updates for the same property.booleanhasNext()Checks, whethergetNext()has a value.protected voidinternalSetIndex(int value)Internal setter forgetIndex()without chain call utility.protected voidinternalSetNext(ListUpdate value)Internal setter forgetNext()without chain call utility.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 ListUpdatereadListUpdate(DataReader in)Reads a new instance from the given reader.static ListUpdatereadListUpdate(JsonReader in)Reads a new instance from the given reader.ListUpdatesetId(int value)ListUpdatesetIndex(int value)ListUpdatesetNext(ListUpdate value)ListUpdatesetNode(SharedGraphNode value)ListUpdatesetProperty(String value)<R,A,E extends Throwable>
Rvisit(Command.Visitor<R,A,E> v, A arg)Accepts the given visitor.abstract <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.Command
getId, getNode, getProperty, hasNode, internalSetId, internalSetNode, internalSetProperty, jsonType, kind, readCommand, readCommand, readContent, writeTo, writeTo
-
Methods inherited from class de.haumacher.msgbuf.data.AbstractDataObject
readContent, readFields, toString, writeContent
-
-
-
-
Constructor Detail
-
ListUpdate
protected ListUpdate()
Creates aListUpdateinstance.
-
-
Method Detail
-
getIndex
public final int getIndex()
The list index that is modified.
-
setIndex
public ListUpdate setIndex(int value)
- See Also:
getIndex()
-
internalSetIndex
protected final void internalSetIndex(int value)
Internal setter forgetIndex()without chain call utility.
-
getNext
public final ListUpdate getNext()
Pointer to chain updates for the same property.
-
setNext
public ListUpdate setNext(ListUpdate value)
- See Also:
getNext()
-
internalSetNext
protected final void internalSetNext(ListUpdate value)
Internal setter forgetNext()without chain call utility.
-
hasNext
public final boolean hasNext()
Checks, whethergetNext()has a value.
-
setId
public ListUpdate setId(int value)
- Overrides:
setIdin classCommand- See Also:
Command.getId()
-
setProperty
public ListUpdate setProperty(String value)
- Overrides:
setPropertyin classCommand- See Also:
Command.getProperty()
-
setNode
public ListUpdate setNode(SharedGraphNode value)
- Overrides:
setNodein classCommand- See Also:
Command.getNode()
-
readListUpdate
public static ListUpdate readListUpdate(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 classCommand- 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 classCommand- Parameters:
in- The reader to take the value from.field- The name of the field whose value should be read.- Throws:
IOException
-
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 classCommand- Parameters:
out- The binary output to write to.- Throws:
IOException- If writing fails.
-
readListUpdate
public static ListUpdate readListUpdate(DataReader in) throws IOException
Reads a new instance from the given reader.- 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 classCommand- Throws:
IOException
-
visit
public abstract <R,A,E extends Throwable> R visit(ListUpdate.Visitor<R,A,E> v, A arg) throws E extends Throwable
Accepts the given visitor.- Throws:
E extends Throwable
-
-