Class Type

  • All Implemented Interfaces:
    java.io.Serializable

    public final class Type
    extends java.lang.Object
    implements java.io.Serializable
    Encapsulates the metadata about the type of a ConfigurationItem, such as: prefix, name, type hierarchy, the source registry etc. This class also provides static methods to retrieve the Type of a CI by name or by class from the DescriptorRegistry.
    See Also:
    Serialized Form
    • Method Detail

      • valueOf

        public static Type valueOf​(java.lang.Class<?> ciClass)
        Parameters:
        ciClass - A ConfigurationItem class object.
        Returns:
        The Type representation of the given CI class.
      • valueOf

        public static Type valueOf​(java.lang.String typeName)
        Parameters:
        typeName - The prefixed name of a ConfigurationItem class.
        Returns:
        The Type representation of the given CI class prefixed name.
      • valueOf

        public static Type valueOf​(java.lang.String prefix,
                                   java.lang.String simpleName)
        Parameters:
        prefix - The CI namespace for the specified ConfigurationItem.
        simpleName - The simple name for the specified ConfigurationItem.
        Returns:
        The Type representation of the given CI.
      • isSubTypeOf

        public boolean isSubTypeOf​(Type superType)
        Parameters:
        superType - The super type against which to verify the inheritance relationship.
        Returns:
        Whether this type is a subtype of the given type.
      • instanceOf

        public boolean instanceOf​(Type selfOrSuperType)
        Parameters:
        selfOrSuperType - The type against which to verify the "instance of" relationship
        Returns:
        Whether this type is a instance of the given type.
      • isSuperTypeOf

        public boolean isSuperTypeOf​(Type subType)
        Parameters:
        subType - The sub type against which to verify the inheritance relationship.
        Returns:
        Whether this type is a super type of the given type.
      • exists

        public boolean exists()
        Returns:
        Whether this type is a registered CI.
      • getPrefix

        public java.lang.String getPrefix()
        Returns:
        The CI namespace for this type.
      • getName

        public java.lang.String getName()
        Returns:
        The simple name for this type.
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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

        public DescriptorRegistryId getTypeSource()
        Returns:
        The id of the descriptor registry.