Class AlternativeTypeInformation

  • All Implemented Interfaces:
    TypeInformation

    public class AlternativeTypeInformation
    extends java.lang.Object
    implements TypeInformation
    Class that combines multiple type restrictions into one using the "or" operator.
    Since:
    0.4.0
    Author:
    Erich Schubert
    • Field Detail

      • restrictions

        private final TypeInformation[] restrictions
        The wrapped type restrictions
    • Constructor Detail

      • AlternativeTypeInformation

        public AlternativeTypeInformation​(TypeInformation... restrictions)
        Constructor.
        Parameters:
        restrictions -
    • Method Detail

      • isAssignableFromType

        public boolean isAssignableFromType​(TypeInformation type)
        Description copied from interface: TypeInformation
        Test whether this type is assignable from another type.
        Specified by:
        isAssignableFromType in interface TypeInformation
        Parameters:
        type - Other type
        Returns:
        true when the other type is accepted as subtype.
      • isAssignableFrom

        public boolean isAssignableFrom​(java.lang.Object other)
        Description copied from interface: TypeInformation
        Test whether this type is assignable from a given object instance.
        Specified by:
        isAssignableFrom in interface TypeInformation
        Parameters:
        other - Other object
        Returns:
        true when the other type is an acceptable instance.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object