Class Variant

java.lang.Object
com.adobe.acs.commons.data.Variant

@ProviderType public final class Variant extends Object
Used to represent values that might be provided as one baseType but used as another. Avoids glue code and switch statements in other parts of the code especially dealing with data from spreadsheets.
  • Constructor Details

    • Variant

      public Variant()
    • Variant

      public Variant(T src)
    • Variant

      public Variant(org.apache.poi.ss.usermodel.Cell src)
    • Variant

      public Variant(org.apache.poi.ss.usermodel.Cell src, Locale locale)
  • Method Details

    • clear

      public void clear()
    • isEmpty

      public boolean isEmpty()
    • setValue

      public final <T> void setValue(T val)
    • toLong

      public Long toLong()
    • toDouble

      public Double toDouble()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toDate

      public Date toDate()
    • toBoolean

      public Boolean toBoolean()
    • isStringTruthy

      public boolean isStringTruthy(String s)
      Truthiness is any non-empty string that looks like a non-zero number or looks like it is True, Yes, or X
      Parameters:
      s - String to evaluate
      Returns:
      True if it is truthy, otherwise false
    • asType

      public <T> T asType(Class<T> type)
    • convert

      public static <S, D> D convert(S val, Class<D> destType)