Class TextTypes


  • public class TextTypes
    extends Object
    Common external text data type definitions. Unless otherwise noted, all defined types exhibit the following behaviors:
    • leading and trailing whitespace is trimmed before parsing
    • the empty string is parsed as a null value
    • a null value is formatted as the empty string
    • Field Detail

      • HEXADECIMAL_BINARY

        public static final TextDataType HEXADECIMAL_BINARY
        Binary token values represented as strings of hexadecimal digits. Null values are indicated by the value set in the containing schema.
      • TEXT_IPV4ADDRESS

        public static final TextDataType TEXT_IPV4ADDRESS
        Ip4Address token values represented as strings in standard form. Null values are indicated by the value set in the containing schema.
      • TEXT_IPV6ADDRESS

        public static final TextDataType TEXT_IPV6ADDRESS
        Ip6Address token values represented as strings in standard form. Null values are indicated by the value set in the containing schema.
      • TRUE_FALSE

        public static final TextDataType TRUE_FALSE
        Boolean token values represented case-insensitively as true and false. Null values are indicated by the value set in the containing schema.
      • RAW_CHARACTER

        public static final TextDataType RAW_CHARACTER
        Character token value represented as single-character strings. Whitespace is not stripped and it is a parsing error if the text is longer than one character. Null values are indicated as specified by the containing schema.
      • ISO_DATE

        public static final TextDataType ISO_DATE
        Date token values represented using ISO-8601 date format. Null values are indicated by the value set in the containing schema.
      • JAVA_DOUBLE

        public static final TextDataType JAVA_DOUBLE
        Double token values represented using default Java double formatting. That is, using Double.parseDouble(String) and Double.toString(double). Null values are indicated by the value set in the containing schema.
      • JAVA_FLOAT

        public static final TextDataType JAVA_FLOAT
        Float token values represented using default Java float formatting. That is, using Float.parseFloat(String) and Float.toString(float). Null values are indicated by the value set in the containing schema.
      • JAVA_INT

        public static final TextDataType JAVA_INT
        Int token values represented using default Java int formatting. That is, using Integer.parseInt(String) and Integer.toString(int). Null values are indicated by the value set in the containing schema.
      • JAVA_LONG

        public static final TextDataType JAVA_LONG
        Long token values represented using default Java long formatting. That is, using Long.parseLong(String) and Long.toString(long). Null values are indicated by the value set in the containing schema.
      • JAVA_NUMERIC

        public static final TextDataType JAVA_NUMERIC
        Numeric token values represented using default Java BigDecimal formatting. That is, using BigDecimal(String) and BigDecimal.toString(long). Null values are indicated by the value set in the containing schema.
      • JAVA_MONEY

        public static final TextDataType JAVA_MONEY
        Money token values represented using default Java Currency formatting. That is, using NumberFormat.getCurrecyInstance() as the format. Null values are indicated by the value set in the containing schema.
      • JAVA_DURATION

        public static final TextDataType JAVA_DURATION
        Duration token values represented using default Java Duration formatting. That is, using java.time.Duration as the format. Null values are indicated by the value set in the containing schema.
      • JAVA_PERIOD

        public static final TextDataType JAVA_PERIOD
        Period token values represented using default Java Period formatting. That is, using java.time.Period as the format. Null values are indicated by the value set in the containing schema.
      • STRING

        public static final TextDataType STRING
        Text type for string token values. Text is converted with the behavior specified in the containing schema.

        This is the default type used for external strings.

      • ISO_TIMEOFDAY

        public static final TextDataType ISO_TIMEOFDAY
        Timestamp token values represented as a time-of-day using ISO-8601 format. The date portion defaults to today's date; ignoring the date yields the time portion represented by the text type. Null values are indicated by the value set in the containing schema.
      • ISO_TIMESTAMP

        public static final TextDataType ISO_TIMESTAMP
        Timestamp token values represented using ISO-8601 timestamp format. Null values are indicated by the value set in the containing schema.
    • Constructor Detail

      • TextTypes

        public TextTypes()
    • Method Detail

      • HEXADECIMAL_BINARY

        public static final TextDataType HEXADECIMAL_BINARY​(String nullIndicator)
        Binary token values represented as strings of hexadecimal digits with null values indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external binary valued type with the specified format
      • TEXT_IPV4ADDRESS

        public static final TextDataType TEXT_IPV4ADDRESS​(String nullIndicator)
        Ip4Address token values represented as strings in standard form with null values indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external ip4address valued type with the specified format
      • TEXT_IPV6ADDRESS

        public static final TextDataType TEXT_IPV6ADDRESS​(String nullIndicator)
        Ip6Address token values represented as strings in standard form with null values indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external ip4address valued type with the specified format
      • INSENSITIVE_BOOLEAN

        public static final TextDataType INSENSITIVE_BOOLEAN​(String trueValue,
                                                             String falseValue)
        Defines an external boolean valued type which maps the specified truth values in a case-insensitive fashion. Null values are indicated by the value set in the containing schema.
        Parameters:
        trueValue - the string value representing true
        falseValue - the string value representing false
        Returns:
        an external boolean type using the given mapping
      • INSENSITIVE_BOOLEAN

        public static final TextDataType INSENSITIVE_BOOLEAN​(String trueValue,
                                                             String falseValue,
                                                             String nullIndicator)
        Defines an external boolean valued type which maps the specified truth values in a case-insensitive fashion. Null values are indicated as specified.
        Parameters:
        trueValue - the string value representing true
        falseValue - the string value representing false
        nullIndicator - the string used to represent a null value
        Returns:
        an external boolean type using the given mapping
      • EXACT_BOOLEAN

        public static final TextDataType EXACT_BOOLEAN​(String trueValue,
                                                       String falseValue)
        Defines an external boolean valued type which maps the specified truth values in a case-sensitive fashion. Null values are indicated by the value set in the containing schema.
        Parameters:
        trueValue - the string value representing true
        falseValue - the string value representing false
        Returns:
        an external boolean type using the given mapping
      • EXACT_BOOLEAN

        public static final TextDataType EXACT_BOOLEAN​(String trueValue,
                                                       String falseValue,
                                                       String nullIndicator)
        Defines an external boolean valued type which maps the specified truth values in a case-sensitive fashion. Null values are indicated as specified.
        Parameters:
        trueValue - the string value representing true
        falseValue - the string value representing false
        nullIndicator - the string used to represent a null value
        Returns:
        an external boolean type using the given mapping
      • MAPPED_BOOLEAN

        public static final TextDataType MAPPED_BOOLEAN​(TruthValues mapping)
        Defines an external boolean valued type using the specified mapping. Null values are indicated by the value set in the containing schema.
        Parameters:
        mapping - the mapping to use between text and boolean values
        Returns:
        the specified external boolean type
      • MAPPED_BOOLEAN

        public static final TextDataType MAPPED_BOOLEAN​(TruthValues mapping,
                                                        String nullIndicator)
        Defines an external boolean valued type using the specified mapping. Null values are indicated as specified.
        Parameters:
        mapping - the mapping to use between text and boolean values
        nullIndicator - the string used to represent a null value
        Returns:
        the specified external boolean type
      • RAW_CHARACTER

        public static final TextDataType RAW_CHARACTER​(String nullIndicator)
        Character token value represented as single-character strings. Whitespace is not stripped and it is a parsing error if the text is longer than one character. Null values are indicated by the value set in the containing schema.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external character valued type with the specified format
      • ISO_DATE

        public static final TextDataType ISO_DATE​(String nullIndicator)
        Date token values represented using ISO-8601 date format. Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external date valued type with the specified format
      • FORMATTED_DATE

        public static TextDataType FORMATTED_DATE​(String format)
        Defines an external date valued type using an arbitrary format. The format may contain time elements, though those element values will be truncated. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external date representation
        Returns:
        a external date valued type with the specified format
        See Also:
        DateTimeFormatting
      • FORMATTED_DATE

        public static TextDataType FORMATTED_DATE​(String format,
                                                  String nullIndicator)
        Defines an external date valued type using an arbitrary format. The format may contain time elements, though those element values will be truncated. Null values are indicated as specified.
        Parameters:
        format - the format of the external date representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external date valued type with the specified format
        See Also:
        DateTimeFormatting
      • FORMATTED_DATE

        public static TextDataType FORMATTED_DATE​(DateTimeFormatting format)
        Defines an external date valued type using an arbitrary DateFormat. The format may contain time elements, though those element values will be truncated. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external date representation
        Returns:
        a external date valued type with the specified format
      • FORMATTED_DATE

        public static TextDataType FORMATTED_DATE​(DateTimeFormatting format,
                                                  String nullIndicator)
        Defines an external date valued type using an arbitrary DateFormat. The format may contain time elements, though those element values will be truncated. Null values are indicated as specified.
        Parameters:
        format - the format of the external date representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external date valued type with the specified format
      • JAVA_DOUBLE

        public static TextDataType JAVA_DOUBLE​(String nullIndicator)
        Double token values represented using default Java double formatting. That is, using Double.parseDouble(String) and Double.toString(double). Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external double valued type with the specified format
      • FORMATTED_DOUBLE

        public static TextDataType FORMATTED_DOUBLE​(NumberFormat format)
        Defines an external double valued type using an arbitrary NumberFormat. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external double representation
        Returns:
        a external double valued type with the specified format
      • FORMATTED_DOUBLE

        public static TextDataType FORMATTED_DOUBLE​(NumberFormat format,
                                                    String nullIndicator)
        Defines an external double valued type using an arbitrary NumberFormat. Null values are indicated as specified.
        Parameters:
        format - the format of the external double representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external double valued type with the specified format
      • GENERIC_OBJECT

        public static TextDataType GENERIC_OBJECT​(Class<?> tokenClass)
        Object token values representing a generic object. Null values are indicated by the value set in the containing schema. This is the default type for objects without custom handling.
      • GENERIC_OBJECT

        public static final TextDataType GENERIC_OBJECT​(Class<?> tokenClass,
                                                        String nullIndicator)
        Object token values representing a generic object. Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a object type
      • GENERIC_OBJECT

        public static final TextDataType GENERIC_OBJECT​(ObjectTokenType<?> type)
        Object token values representing a generic object. Null values are indicated by the value set in the containing schema.
        Returns:
        a object type
      • GENERIC_OBJECT

        public static final TextDataType GENERIC_OBJECT​(ObjectTokenType<?> type,
                                                        String nullIndicator)
        Object token values representing a generic object. Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a object type
      • JAVA_FLOAT

        public static TextDataType JAVA_FLOAT​(String nullIndicator)
        Float token values represented using default Java float formatting. That is, using Float.parseFloat(String) and Float.toString(float). Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external float valued type with the specified format
      • FORMATTED_FLOAT

        public static TextDataType FORMATTED_FLOAT​(NumberFormat format)
        Defines an external float valued type using an arbitrary NumberFormat. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external float representation
        Returns:
        a external float valued type with the specified format
      • FORMATTED_FLOAT

        public static TextDataType FORMATTED_FLOAT​(NumberFormat format,
                                                   String nullIndicator)
        Defines an external float valued type using an arbitrary NumberFormat. Null values are indicated as specified.
        Parameters:
        format - the format of the external float representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external float valued type with the specified format
      • JAVA_INT

        public static TextDataType JAVA_INT​(String nullIndicator)
        Int token values represented using default Java int formatting. That is, using Integer.parseInt(String) and Integer.toString(int). Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external int valued type with the specified format
      • FORMATTED_INT

        public static TextDataType FORMATTED_INT​(NumberFormat format)
        Defines an external int valued type using an arbitrary NumberFormat. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external int representation
        Returns:
        a external int valued type with the specified format
      • FORMATTED_INT

        public static TextDataType FORMATTED_INT​(NumberFormat format,
                                                 String nullIndicator)
        Defines an external int valued type using an arbitrary NumberFormat. Null values are indicated as specified.
        Parameters:
        format - the format of the external int representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external int valued type with the specified format
      • JAVA_LONG

        public static TextDataType JAVA_LONG​(String nullIndicator)
        Long token values represented using default Java long formatting. That is, using Long.parseLong(String) and Long.toString(long). Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external long valued type with the specified format
      • FORMATTED_LONG

        public static TextDataType FORMATTED_LONG​(NumberFormat format)
        Defines an external long valued type using an arbitrary NumberFormat. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external long representation
        Returns:
        a external long valued type with the specified format
      • FORMATTED_LONG

        public static TextDataType FORMATTED_LONG​(NumberFormat format,
                                                  String nullIndicator)
        Defines an external long valued type using an arbitrary NumberFormat. Null values are indicated as specified.
        Parameters:
        format - the format of the external long representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external long valued type with the specified format
      • JAVA_NUMERIC

        public static TextDataType JAVA_NUMERIC​(String nullIndicator)
        Numeric token values represented using default Java BigDecimal formatting. That is, using BigDecimal(String) and BigDecimal.toString(long). Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external numeric valued type with the specified format
      • FORMATTED_NUMERIC

        public static TextDataType FORMATTED_NUMERIC​(NumberFormat format)
        Defines an external numeric valued type using an arbitrary NumberFormat. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external numeric representation
        Returns:
        a external numeric valued type with the specified format
      • FORMATTED_NUMERIC

        public static TextDataType FORMATTED_NUMERIC​(NumberFormat format,
                                                     String nullIndicator)
        Defines an external numeric valued type using an arbitrary NumberFormat. Null values are indicated as specified.
        Parameters:
        format - the format of the external numeric representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external numeric valued type with the specified format
      • JAVA_MONEY

        public static TextDataType JAVA_MONEY​(String nullIndicator)
        Money token values represented using default Java Currency formatting. That is, using NumberFormat.getCurrecyInstance() as the format. Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external money valued type with the specified format
      • FORMATTED_MONEY

        public static TextDataType FORMATTED_MONEY​(NumberFormat format)
        Defines an external money valued type using an arbitrary NumberFormat. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external numeric representation
        Returns:
        a external money valued type with the specified format
      • FORMATTED_MONEY

        public static TextDataType FORMATTED_MONEY​(NumberFormat format,
                                                   String nullIndicator)
        Defines an external money valued type using an arbitrary NumberFormat. Null values are indicated as specified.
        Parameters:
        format - the format of the external money representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external money valued type with the specified format
      • JAVA_DURATION

        public static TextDataType JAVA_DURATION​(String nullIndicator)
        Duration token values represented using default Java Duration formatting. That is, using java.time.Duration as the format. Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external duration valued type with the specified format
      • FORMATTED_DURATION

        public static TextDataType FORMATTED_DURATION​(String format)
        Defines an external duration valued type using an arbitrary format. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external duration representation
        Returns:
        a duration type with the specified format
        See Also:
        IntervalFormatting
      • FORMATTED_DURATION

        public static TextDataType FORMATTED_DURATION​(String format,
                                                      String nullIndicator)
        Defines an external duration valued type using an arbitrary format. Null values are indicated as specified.
        Parameters:
        format - the format of the external duration representation
        nullIndicator - the string used to represent a null value
        Returns:
        a duration type with the specified format
        See Also:
        IntervalFormatting
      • FORMATTED_DURATION

        public static TextDataType FORMATTED_DURATION​(IntervalFormatting format)
        Defines an external duration valued type using an arbitrary format. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external duration representation
        Returns:
        a duration type with the specified format
      • FORMATTED_DURATION

        public static TextDataType FORMATTED_DURATION​(IntervalFormatting format,
                                                      String nullIndicator)
        Defines an external duration valued type using an arbitrary format. Null values are indicated as specified.
        Parameters:
        format - the format of the external duration representation
        nullIndicator - the string used to represent a null value
        Returns:
        a duration type with the specified format
      • JAVA_PERIOD

        public static TextDataType JAVA_PERIOD​(String nullIndicator)
        Period token values represented using default Java Period formatting. That is, using java.time.Period as the format. Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external period valued type with the specified format
      • FORMATTED_PERIOD

        public static TextDataType FORMATTED_PERIOD​(String format)
        Defines an external period valued type using an arbitrary format. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external period representation
        Returns:
        a period type with the specified format
        See Also:
        IntervalFormatting
      • FORMATTED_PERIOD

        public static TextDataType FORMATTED_PERIOD​(String format,
                                                    String nullIndicator)
        Defines an external period valued type using an arbitrary format. Null values are indicated as specified.
        Parameters:
        format - the format of the external period representation
        nullIndicator - the string used to represent a null value
        Returns:
        a period type with the specified format
        See Also:
        IntervalFormatting
      • FORMATTED_PERIOD

        public static TextDataType FORMATTED_PERIOD​(IntervalFormatting format)
        Defines an external period valued type using an arbitrary format. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external period representation
        Returns:
        a period type with the specified format
      • FORMATTED_PERIOD

        public static TextDataType FORMATTED_PERIOD​(IntervalFormatting format,
                                                    String nullIndicator)
        Defines an external period valued type using an arbitrary format. Null values are indicated as specified.
        Parameters:
        format - the format of the external period representation
        nullIndicator - the string used to represent a null value
        Returns:
        a period type with the specified format
      • STRING

        public static final TextDataType STRING​(TextTypes.StringConversion behavior)
        String token values with the specified conversion behavior. Null values are indicated by the value set in the containing schema.
        Parameters:
        behavior - indicates how text is to be converted to string values
        Returns:
        a external string type with the specified format
      • STRING

        public static final TextDataType STRING​(TextTypes.StringConversion behavior,
                                                String nullIndicator)
        String token values with the specified conversion behavior and null indicator.
        Parameters:
        behavior - indicates how text is to be converted to string values
        nullIndicator - the string used to represent a null value
        Returns:
        a external string type with the specified format
      • ISO_TIMEOFDAY

        public static final TextDataType ISO_TIMEOFDAY​(String nullIndicator)
        Timestamp token values represented as a time-of-day using ISO-8601 format. The date portion defaults to today's date; ignoring the date yields the time portion represented by the text type.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external timestamp type with the specified format
      • FORMATTED_TIMEOFDAY

        public static TextDataType FORMATTED_TIMEOFDAY​(String format)
        Defines an external time valued type using an arbitrary format. The format may contain date elements, though those element values will be truncated. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external time representation
        Returns:
        a external time valued type with the specified format
        See Also:
        DateTimeFormatting
      • FORMATTED_TIMEOFDAY

        public static TextDataType FORMATTED_TIMEOFDAY​(String format,
                                                       String nullIndicator)
        Defines an external time valued type using an arbitrary format. The format may contain date elements, though those element values will be truncated. Null values are indicated as specified.
        Parameters:
        format - the format of the external time representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external time valued type with the specified format
        See Also:
        DateTimeFormatting
      • FORMATTED_TIMEOFDAY

        public static TextDataType FORMATTED_TIMEOFDAY​(DateTimeFormatting format)
        Defines an external time valued type using an arbitrary format. The format may contain date elements, though those element values will be truncated. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external time representation
        Returns:
        a external time valued type with the specified format
      • FORMATTED_TIMEOFDAY

        public static TextDataType FORMATTED_TIMEOFDAY​(DateTimeFormatting format,
                                                       String nullIndicator)
        Defines an external time valued type using an arbitrary format. The format may contain date elements, though those element values will be truncated. Null values are indicated as specified.
        Parameters:
        format - the format of the external time representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external time valued type with the specified format
      • ISO_TIMESTAMP

        public static final TextDataType ISO_TIMESTAMP​(String nullIndicator)
        Timestamp token values represented using ISO-8601 timestamp format. Null values are indicated as specified.
        Parameters:
        nullIndicator - the string used to represent a null value
        Returns:
        a external timestamp type with the specified format
      • FORMATTED_TIMESTAMP

        public static TextDataType FORMATTED_TIMESTAMP​(String format)
        Defines an external timestamp valued type using an arbitrary format. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external timestamp representation
        Returns:
        a external timestamp type with the specified format
        See Also:
        DateTimeFormatting
      • FORMATTED_TIMESTAMP

        public static TextDataType FORMATTED_TIMESTAMP​(String format,
                                                       String nullIndicator)
        Defines an external timestamp valued type using an arbitrary format. Null values are indicated as specified.
        Parameters:
        format - the format of the external timestamp representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external timestamp type with the specified format
        See Also:
        DateTimeFormatting
      • FORMATTED_TIMESTAMP

        public static TextDataType FORMATTED_TIMESTAMP​(DateTimeFormatting format)
        Defines an external timestamp valued type using an arbitrary format. Null values are indicated by the value set in the containing schema.
        Parameters:
        format - the format of the external timestamp representation
        Returns:
        a external timestamp type with the specified format
      • FORMATTED_TIMESTAMP

        public static TextDataType FORMATTED_TIMESTAMP​(DateTimeFormatting format,
                                                       String nullIndicator)
        Defines an external timestamp valued type using an arbitrary format. Null values are indicated as specified.
        Parameters:
        format - the format of the external timestamp representation
        nullIndicator - the string used to represent a null value
        Returns:
        a external timestamp type with the specified format
      • getDefaultExternalType

        public static TextDataType getDefaultExternalType​(ScalarTokenType type)
        Gets the default external type for the given token type.
        Parameters:
        type - the type for which to get the default
        Returns:
        the external type associated with the specified internal type