Class AbstractConvertFromString

All Implemented Interfaces:
Direct Known Subclasses:
ConvertStringToBoolean, ConvertStringToDate, ConvertStringToDecimal, ConvertStringToDouble, ConvertStringToInt, ConvertStringToInterval, ConvertStringToLong, ConvertStringToTime, ConvertStringToTimeStamp

public abstract class AbstractConvertFromString extends DirectConverter
Abstract class for string-to-something conversions. Handles the multiple ways that strings can be set.
  • Field Details

    • logger

      protected static final org.slf4j.Logger logger
    • prepare

      protected final Function<String,String> prepare
  • Constructor Details

    • AbstractConvertFromString

      public AbstractConvertFromString(ScalarWriter baseWriter)
    • AbstractConvertFromString

      public AbstractConvertFromString(ScalarWriter baseWriter, Map<String,String> properties)
  • Method Details

    • setValue

      public void setValue(Object value)
      Description copied from interface: ValueWriter
      Write value to a vector as a Java object of the "native" type for the column. This form is available only on scalar writers. The object must be of the form for the primary write method above.

      Primarily to be used when the code already knows the object type.

      Specified by:
      setValue in interface ValueWriter
      setValue in class DirectConverter
      value - a value that matches the primary setter above, or null to set the column to null
      See Also:
    • setBytes

      public void setBytes(byte[] bytes, int length)
      Specified by:
      setBytes in interface ValueWriter
      setBytes in class DirectConverter