Class NumberOption
- java.lang.Object
-
- de.haumacher.msgbuf.data.AbstractDataObject
-
- de.haumacher.msgbuf.generator.ast.Option
-
- de.haumacher.msgbuf.generator.ast.NumberOption
-
- All Implemented Interfaces:
DataObject,ReflectiveDataObject,Observable
public class NumberOption extends Option
Optionannotating an int value
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.haumacher.msgbuf.generator.ast.Option
Option.TypeKind, Option.Visitor<R,A>
-
-
Field Summary
Fields Modifier and Type Field Description static StringNUMBER_OPTION__TYPEIdentifier for theNumberOptiontype in JSON format.static StringVALUE__PROP
-
Constructor Summary
Constructors Modifier Constructor Description protectedNumberOption()Creates aNumberOptioninstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static NumberOptioncreate()Creates aNumberOptioninstance.Objectget(String field)doublegetValue()The number assigned to the option.protected voidinternalSetValue(double value)Internal setter forgetValue()without chain call utility.StringjsonType()Option.TypeKindkind()The type code of this instance.List<String>properties()protected voidreadField(JsonReader in, String field)static NumberOptionreadNumberOption(JsonReader in)Reads a new instance from the given reader.voidset(String field, Object value)NumberOptionsetValue(double value)<R,A>
Rvisit(Option.Visitor<R,A> v, A arg)Accepts the given visitor.protected voidwriteFields(JsonWriter out)-
Methods inherited from class de.haumacher.msgbuf.generator.ast.Option
internalRegisterListener, internalUnregisterListener, readOption, registerListener, unregisterListener, writeTo
-
Methods inherited from class de.haumacher.msgbuf.data.AbstractDataObject
readContent, readFields, toString, writeContent
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface de.haumacher.msgbuf.data.ReflectiveDataObject
transientProperties
-
-
-
-
Field Detail
-
NUMBER_OPTION__TYPE
public static final String NUMBER_OPTION__TYPE
Identifier for theNumberOptiontype in JSON format.- See Also:
- Constant Field Values
-
VALUE__PROP
public static final String VALUE__PROP
- See Also:
getValue(), Constant Field Values
-
-
Constructor Detail
-
NumberOption
protected NumberOption()
Creates aNumberOptioninstance.- See Also:
create()
-
-
Method Detail
-
create
public static NumberOption create()
Creates aNumberOptioninstance.
-
kind
public Option.TypeKind kind()
Description copied from class:OptionThe type code of this instance.
-
getValue
public final double getValue()
The number assigned to the option.
-
setValue
public NumberOption setValue(double value)
- See Also:
getValue()
-
internalSetValue
protected final void internalSetValue(double value)
Internal setter forgetValue()without chain call utility.
-
jsonType
public String jsonType()
-
readNumberOption
public static NumberOption readNumberOption(JsonReader in) throws IOException
Reads a new instance from the given reader.- Throws:
IOException
-
writeFields
protected void writeFields(JsonWriter out) throws IOException
- Overrides:
writeFieldsin classAbstractDataObject- Throws:
IOException
-
readField
protected void readField(JsonReader in, String field) throws IOException
- Overrides:
readFieldin classAbstractDataObject- Throws:
IOException
-
visit
public <R,A> R visit(Option.Visitor<R,A> v, A arg)
Description copied from class:OptionAccepts the given visitor.
-
-