Class StringObjectPromoter

java.lang.Object
io.nosqlbench.virtdata.core.bindings.StringObjectPromoter

public class StringObjectPromoter extends Object
  • Constructor Details

    • StringObjectPromoter

      public StringObjectPromoter()
  • Method Details

    • promote

      public static Object promote(String raw, Class<?> targetType)
      Specialize the type of an object according to a target class.
      Parameters:
      raw - The string representation of an object.
      targetType - The target object type
      Returns:
      The promoted form, in the target class, or the original value if the format failed or the class type was not supported.
    • promote

      public static Object promote(String stringArg)
      Specialize the form of a string argument around the apparent object type.
      Parameters:
      stringArg - The raw value in string form
      Returns:
      the specialized object type, or the original string format if nothing was found to be
    • isAssignableForConstructor

      public static boolean isAssignableForConstructor(Class<?> have, Class<?> need)
      If a boxed type would suffice for a constructor call, even though Class.isAssignableFrom(Class) says the assignment wouldn't work, return true;
      Parameters:
      have - The class that we have.
      need - The class that we need.
      Returns:
      true, if the class that we have would work for a constructor call, due to unboxing.