Class MapType
- java.lang.Object
-
- de.haumacher.msgbuf.data.AbstractDataObject
-
- de.haumacher.msgbuf.generator.ast.Type
-
- de.haumacher.msgbuf.generator.ast.MapType
-
- All Implemented Interfaces:
DataObject,ReflectiveDataObject,Observable
public class MapType extends Type
ATypethat is composed of a key and a value.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.haumacher.msgbuf.generator.ast.Type
Type.TypeKind, Type.Visitor<R,A>
-
-
Field Summary
Fields Modifier and Type Field Description static StringKEY_TYPE__PROPstatic StringMAP_TYPE__TYPEIdentifier for theMapTypetype in JSON format.static StringVALUE_TYPE__PROP
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MapTypecreate()Creates aMapTypeinstance.Objectget(String field)TypegetKeyType()The key type of this map.TypegetValueType()The value type of this map.booleanhasKeyType()Checks, whethergetKeyType()has a value.booleanhasValueType()Checks, whethergetValueType()has a value.protected voidinternalSetKeyType(Type value)Internal setter forgetKeyType()without chain call utility.protected voidinternalSetValueType(Type value)Internal setter forgetValueType()without chain call utility.StringjsonType()Type.TypeKindkind()The type code of this instance.List<String>properties()protected voidreadField(JsonReader in, String field)static MapTypereadMapType(JsonReader in)Reads a new instance from the given reader.voidset(String field, Object value)MapTypesetKeyType(Type value)MapTypesetValueType(Type value)<R,A>
Rvisit(Type.Visitor<R,A> v, A arg)Accepts the given visitor.protected voidwriteFields(JsonWriter out)-
Methods inherited from class de.haumacher.msgbuf.generator.ast.Type
internalRegisterListener, internalUnregisterListener, readType, 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
-
MAP_TYPE__TYPE
public static final String MAP_TYPE__TYPE
Identifier for theMapTypetype in JSON format.- See Also:
- Constant Field Values
-
KEY_TYPE__PROP
public static final String KEY_TYPE__PROP
- See Also:
getKeyType(), Constant Field Values
-
VALUE_TYPE__PROP
public static final String VALUE_TYPE__PROP
- See Also:
getValueType(), Constant Field Values
-
-
Method Detail
-
kind
public Type.TypeKind kind()
Description copied from class:TypeThe type code of this instance.
-
getKeyType
public final Type getKeyType()
The key type of this map.
-
setKeyType
public MapType setKeyType(Type value)
- See Also:
getKeyType()
-
internalSetKeyType
protected final void internalSetKeyType(Type value)
Internal setter forgetKeyType()without chain call utility.
-
hasKeyType
public final boolean hasKeyType()
Checks, whethergetKeyType()has a value.
-
getValueType
public final Type getValueType()
The value type of this map.
-
setValueType
public MapType setValueType(Type value)
- See Also:
getValueType()
-
internalSetValueType
protected final void internalSetValueType(Type value)
Internal setter forgetValueType()without chain call utility.
-
hasValueType
public final boolean hasValueType()
Checks, whethergetValueType()has a value.
-
jsonType
public String jsonType()
-
readMapType
public static MapType readMapType(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(Type.Visitor<R,A> v, A arg)
Description copied from class:TypeAccepts the given visitor.
-
-