Class JavaVal.Helper

java.lang.Object
org.kink_lang.kink.JavaVal.Helper
Enclosing class:
JavaVal

public static class JavaVal.Helper extends Object
The helper of JavaVals.
See Also:
  • Method Details

    • of

      public JavaVal of(@Nullable Object object, Class<?> type)
      Returns a java val.

      The object must be able to typed as type. Namely,

      • object is null and type is not a primitive type,
      • object is a boxed value and type is the corresponding primitive type,
      • or object is not null and type.isInstance(object) is true.
      Parameters:
      object - the nullable java object reference
      type - the static type.
      Returns:
      a java val.
      Throws:
      IllegalArgumentException - if object cannot be typed as type.