Class JavaVal

All Implemented Interfaces:
HostResult

public class JavaVal extends Val
A java val.

A java val consists of an object reference, and a static type. the object reference is always typable as the static type. Namely,

  • the object is null and the static type is not a primitive type,
  • the object is a boxed value and the static type is the corresponding primitive type,
  • or the object is not null and an instance of the static type.
  • Method Details

    • objectReference

      @Nullable public Object objectReference()
      Returns the java object reference.
      Returns:
      the java object reference.
    • staticType

      public Class<?> staticType()
      Returns the static type of the java object reference.
      Returns:
      the static type of the java object reference.
    • toString

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

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object arg)
      Returns true if the argument is equal to this java val.

      Namely, if

      • they are members of the same vm,
      • the object references are identical (via Java == operator),
      • and the static types are equal.
      Overrides:
      equals in class Object
      Parameters:
      arg - the object to test.
      Returns:
      true if the argument is equal to this java val.