Package com.apama.event.parser
Class OptionalFieldType<T>
- java.lang.Object
-
- com.apama.event.parser.FieldType<T>
-
- com.apama.event.parser.OptionalFieldType<T>
-
public class OptionalFieldType<T> extends FieldType<T>
Represents the Apamaoptional
type, for which values are specified asFieldType
objects.This class cannot be instantiated explicitly, but should be referenced using
FieldTypes.optional(FieldType)
.
-
-
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.T
defaultValue()
Get the default value for Optional field type.FieldType<T>
getContainedType()
Get the FieldTypeof the containedType java.lang.String
getName()
Return the name of this type.T
parse(java.lang.String value)
Convert a value of this type from the format used in Apama event strings, into an object of type T, the same type as the containedType parameter when creating this optional field type.java.lang.String
toString()
Returns a String representation of the field type.-
Methods inherited from class com.apama.event.parser.FieldType
format, getTypeClass, newField
-
-
-
-
Method Detail
-
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<T>
-
parse
public T parse(java.lang.String value) throws ParserRuntimeException
Convert a value of this type from the format used in Apama event strings, into an object of type T, the same type as the containedType parameter when creating this optional field type.- Overrides:
parse
in classFieldType<T>
- 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.
-
defaultValue
public T defaultValue()
Get the default value for Optional field type.- Specified by:
defaultValue
in classFieldType<T>
- Returns:
- null as default value for optional
-
getName
public java.lang.String getName()
Description copied from class:FieldType
Return the name of this type.
-
getContainedType
public FieldType<T> getContainedType()
Get the FieldTypeof the containedType - Returns:
-
-