Class ObjectType

java.lang.Object
org.jfuncmachine.compiler.model.types.ObjectType
All Implemented Interfaces:
Type

public final class ObjectType extends Object implements Type
An object type
  • Field Details

    • className

      public final String className
      The class name of the object
    • representsEnum

      public final boolean representsEnum
      True if this class represents an enum
  • Constructor Details

    • ObjectType

      public ObjectType()
      Create an object type for java.lang.Object
    • ObjectType

      public ObjectType(String className)
      Create an object type for the given class name
      Parameters:
      className - The class name of this object type
    • ObjectType

      public ObjectType(Class clazz)
      Create an object type from the given class
      Parameters:
      clazz - The class to extract the class name from
    • ObjectType

      public ObjectType(String className, boolean representsEnum)
      Create an object type for the given class name
      Parameters:
      className - The class name of this object type
      representsEnum - True if this class is an enum
  • Method Details

    • getUnboxedType

      public Type getUnboxedType()
      Description copied from interface: Type
      Returns the unboxed type of this type, if any
      Specified by:
      getUnboxedType in interface Type
      Returns:
      The unboxed type of this type, or null if there isn't one
    • isUnboxableTo

      public boolean isUnboxableTo(Type desiredType)
      Tests whether this object type can be unboxed to a specific type
      Parameters:
      desiredType - The type that the object should be unboxed to
      Returns:
      True if this object type can be unboxed to the desired type
    • isBoxableFrom

      public boolean isBoxableFrom(Type desiredType)
      Tests whether this object type can be a box for the specified type
      Parameters:
      desiredType - The type that is supposed to be boxed
      Returns:
      True if this object type can serve as a box from the desired type
    • isBoxType

      public boolean isBoxType()
      Description copied from interface: Type
      Test whether this type is a box type
      Specified by:
      isBoxType in interface Type
      Returns:
      True if this type is a box type
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object