Package org.h2.value

Class ValueChar

  • All Implemented Interfaces:
    HasSQL, Typed

    public final class ValueChar
    extends ValueStringBase
    Implementation of the CHARACTER data type.
    • Constructor Detail

      • ValueChar

        private ValueChar​(java.lang.String value)
    • Method Detail

      • getValueType

        public int getValueType()
        Description copied from class: Value
        Get the value type.
        Specified by:
        getValueType in class Value
        Returns:
        the value type
      • compareTypeSafe

        public int compareTypeSafe​(Value v,
                                   CompareMode mode,
                                   CastDataProvider provider)
        Description copied from class: Value
        Compare this value against another value given that the values are of the same data type.
        Overrides:
        compareTypeSafe in class ValueStringBase
        Parameters:
        v - the other value
        mode - the compare mode
        provider - the cast information provider
        Returns:
        0 if both values are equal, -1 if the other value is smaller, and 1 otherwise
      • getSQL

        public java.lang.StringBuilder getSQL​(java.lang.StringBuilder builder,
                                              int sqlFlags)
        Description copied from interface: HasSQL
        Appends the SQL statement of this object to the specified builder.
        Parameters:
        builder - string builder
        sqlFlags - formatting flags
        Returns:
        the specified string builder
      • get

        public static ValueChar get​(java.lang.String s)
        Get or create a CHAR value for the given string.
        Parameters:
        s - the string
        Returns:
        the value