Class MapType

  • All Implemented Interfaces:
    de.haumacher.msgbuf.data.DataObject, de.haumacher.msgbuf.data.ReflectiveDataObject, de.haumacher.msgbuf.observer.Observable

    public class MapType
    extends Type
    A Type that is composed of a key and a value.
    • Constructor Detail

      • MapType

        protected MapType()
        Creates a MapType instance.
        See Also:
        create()
    • Method Detail

      • kind

        public Type.TypeKind kind()
        Description copied from class: Type
        The type code of this instance.
        Specified by:
        kind in class Type
      • getKeyType

        public final Type getKeyType()
        The key type of this map.
      • internalSetKeyType

        protected final void internalSetKeyType​(Type value)
        Internal setter for getKeyType() without chain call utility.
      • hasKeyType

        public final boolean hasKeyType()
        Checks, whether getKeyType() has a value.
      • getValueType

        public final Type getValueType()
        The value type of this map.
      • internalSetValueType

        protected final void internalSetValueType​(Type value)
        Internal setter for getValueType() without chain call utility.
      • hasValueType

        public final boolean hasValueType()
        Checks, whether getValueType() has a value.
      • jsonType

        public String jsonType()
      • readMapType

        public static MapType readMapType​(de.haumacher.msgbuf.json.JsonReader in)
                                   throws IOException
        Reads a new instance from the given reader.
        Throws:
        IOException
      • writeFields

        protected void writeFields​(de.haumacher.msgbuf.json.JsonWriter out)
                            throws IOException
        Overrides:
        writeFields in class de.haumacher.msgbuf.data.AbstractDataObject
        Throws:
        IOException
      • readField

        protected void readField​(de.haumacher.msgbuf.json.JsonReader in,
                                 String field)
                          throws IOException
        Overrides:
        readField in class de.haumacher.msgbuf.data.AbstractDataObject
        Throws:
        IOException
      • visit

        public <R,​A> R visit​(Type.Visitor<R,​A> v,
                                   A arg)
        Description copied from class: Type
        Accepts the given visitor.
        Specified by:
        visit in class Type