Class DictionaryFieldType<K,​V>

  • Type Parameters:
    K - The Java type used for the keys of this dictionary.
    V - The Java type used for the values of this dictionary.

    public class DictionaryFieldType<K,​V>
    extends FieldType<java.util.Map<K,​V>>
    Represents the Apama dictionary<key,item> type, for which values are specified as Map objects.
    • Constructor Summary

      Constructors 
      Constructor Description
      DictionaryFieldType​(FieldType<K> keyType, FieldType<V> valueType)
      Construct a new field type representing a dictionary whose keys are values are of specified field types.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void assertAssignable​(java.lang.Object c, java.lang.String fieldName)
      This method is intended for internal use only and may be removed at any time - do not use.
      java.util.Map<K,​V> defaultValue()
      Get the default value for Dictionary field type.
      FieldType<K> getKeyType()
      Get the type of the keys
      java.lang.String getName()
      Return the name of this type.
      FieldType<V> getValueType()
      Get the type of the values
      java.util.Map<K,​V> parse​(java.lang.String value)
      Convert a value of this type from the format used in Apama event strings, into a Map object.
      java.lang.String toString()
      Returns a String representation of the field type.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • DictionaryFieldType

        public DictionaryFieldType​(FieldType<K> keyType,
                                   FieldType<V> valueType)
        Construct a new field type representing a dictionary whose keys are values are of specified field types. This constructor is provided for backwards compatibility, the recommended way to construct this field type is with FieldTypes.dictionary(FieldType, FieldType).
        Parameters:
        keyType - type of keys this dictionary contains
        valueType - type of values this dictionary contains
        See Also:
        FieldTypes.dictionary(FieldType, FieldType)
    • Method Detail

      • getKeyType

        public FieldType<K> getKeyType()
        Get the type of the keys
        Returns:
        the FieldType of the keys
      • getValueType

        public FieldType<V> getValueType()
        Get the type of the values
        Returns:
        the FieldType of the values
      • getName

        public java.lang.String getName()
        Description copied from class: FieldType
        Return the name of this type.
        Overrides:
        getName in class FieldType<java.util.Map<K,​V>>
        Returns:
        the type name
      • assertAssignable

        public void assertAssignable​(java.lang.Object c,
                                     java.lang.String fieldName)
        Description copied from class: FieldType
        This method is intended for internal use only and may be removed at any time - do not use.
        Specified by:
        assertAssignable in class FieldType<java.util.Map<K,​V>>
      • parse

        public java.util.Map<K,​V> parse​(java.lang.String value)
                                       throws ParserRuntimeException
        Convert a value of this type from the format used in Apama event strings, into a Map object.
        Overrides:
        parse in class FieldType<java.util.Map<K,​V>>
        Parameters:
        value - the value to parse.
        Returns:
        an object specifying the value of the string that was parsed.
        Throws:
        ParserRuntimeException - If the specified value string cannot be parsed.
      • toString

        public java.lang.String toString()
        Description copied from class: FieldType
        Returns a String representation of the field type. Note that this representation will use the Java toString() method to format the results, and is not valid monitorscript.
        Overrides:
        toString in class FieldType<java.util.Map<K,​V>>
      • defaultValue

        public java.util.Map<K,​V> defaultValue()
        Get the default value for Dictionary field type.
        Specified by:
        defaultValue in class FieldType<java.util.Map<K,​V>>
        Returns:
        An empty Map