Class OptionalFieldType<T>


  • public class OptionalFieldType<T>
    extends FieldType<T>
    Represents the Apama optional type, for which values are specified as FieldType 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 FieldType of 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 java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 class FieldType<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 class FieldType<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 class FieldType<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.
        Overrides:
        getName in class FieldType<T>
        Returns:
        the type name
      • getContainedType

        public FieldType<T> getContainedType()
        Get the FieldType of the containedType
        Returns:
      • 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<T>