Class Any

  • All Implemented Interfaces:
    Type

    public final class Any
    extends Object
    implements Type
    This Type represents a Type that can be assigned to any other Type. Note that this Type is different from a TypeVariable in that it is conceptually a concrete type, not a stand-in for a type.
    Author:
    Gabriel Selzer
    • Constructor Detail

      • Any

        public Any()
      • Any

        public Any​(Type[] upperBounds)
      • Any

        public Any​(Type[] upperBounds,
                   Type[] lowerBounds)
    • Method Detail

      • getUpperBounds

        public Type[] getUpperBounds()
      • getLowerBounds

        public Type[] getLowerBounds()
      • equals

        public boolean equals​(Object obj)
        This method returns true iff:
        • obj is an Any
        • obj.getUpperBounds is equal to this.getUpperBounds (disregarding the order of each array)
        • obj.getLowerBounds is equal to this.getLowerBounds (disregarding the order of each array)
        This is a rather strict definition of equality, however it is necessary to preserve transitivity.
        Overrides:
        equals in class Object
      • hashCode

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

        public static boolean is​(Object o)