Package com.apama.event.parser
Class DictionaryFieldType<K,V>
- java.lang.Object
-
- com.apama.event.parser.FieldType<java.util.Map<K,V>>
-
- com.apama.event.parser.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 Apamadictionary<key,item>
type, for which values are specified asMap
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 keysjava.lang.String
getName()
Return the name of this type.FieldType<V>
getValueType()
Get the type of the valuesjava.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 com.apama.event.parser.FieldType
format, getTypeClass, newField
-
-
-
-
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 withFieldTypes.dictionary(FieldType, FieldType)
.- Parameters:
keyType
- type of keys this dictionary containsvalueType
- 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.
-
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 classFieldType<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 classFieldType<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.
-
-