Class Type
- java.lang.Object
-
- com.xebialabs.deployit.plugin.api.reflect.Type
-
- All Implemented Interfaces:
java.io.Serializable
public final class Type extends java.lang.Object implements java.io.SerializableEncapsulates the metadata about the type of aConfigurationItem, 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 Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)booleanexists()DescriptorgetDescriptor()java.lang.StringgetName()java.lang.StringgetPrefix()DescriptorRegistryIdgetTypeSource()inthashCode()booleaninstanceOf(Type selfOrSuperType)booleanisSubTypeOf(Type superType)booleanisSuperTypeOf(Type subType)java.lang.StringtoString()static TypevalueOf(java.lang.Class<?> ciClass)static TypevalueOf(java.lang.String typeName)static TypevalueOf(java.lang.String prefix, java.lang.String simpleName)
-
-
-
Method Detail
-
valueOf
public static Type valueOf(java.lang.Class<?> ciClass)
- Parameters:
ciClass- AConfigurationItemclass 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 aConfigurationItemclass.- 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 specifiedConfigurationItem.simpleName- The simple name for the specifiedConfigurationItem.- Returns:
- The Type representation of the given CI.
-
getDescriptor
public Descriptor getDescriptor()
- Returns:
- The metadata about this
ConfigurationItem.
-
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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getTypeSource
public DescriptorRegistryId getTypeSource()
- Returns:
- The id of the descriptor registry.
-
-