Package com.xebialabs.deployit.plugin.api.reflect

# Class Type

java.lang.Object
com.xebialabs.deployit.plugin.api.reflect.Type

All Implemented Interfaces:
  `Serializable`

public final class Type extends Object implements 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 Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `boolean`
  `exists()`
  `Descriptor`
  `getDescriptor()`
  `String`
  `getName()`
  `String`
  `getPrefix()`
  `DescriptorRegistryId`
  `getTypeSource()`
  `int`
  `hashCode()`
  `boolean`
  `instanceOf(Type selfOrSuperType)`
  `boolean`
  `isSubTypeOf(Type superType)`
  `boolean`
  `isSuperTypeOf(Type subType)`
  `String`
  `toString()`
  `static Type`
  `valueOf(Class<?> ciClass)`
  `static Type`
  `valueOf(String typeName)`
  `static Type`
  `valueOf(String prefix, String simpleName)`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Method Details

  - ### valueOf

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

  - ### valueOf

    public static Type valueOf(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(String prefix, 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.

  - ### 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 String getPrefix()
    Returns:
      The CI namespace for this type.

  - ### getName

    public String getName()
    Returns:
      The simple name for this type.

  - ### equals

    public boolean equals(Object o)
    Overrides:
      `equals` in class `Object`

  - ### hashCode

    public int hashCode()
    Overrides:
      `hashCode` in class `Object`

  - ### toString

    public String toString()
    Overrides:
      `toString` in class `Object`

  - ### getTypeSource

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