Class TypeDescriptor

java.lang.Object
org.pipservices3.commons.reflect.TypeDescriptor

public class TypeDescriptor extends Object
Descriptor that points to specific object type by it's name and optional library (or module) where this type is defined.

This class has symmetric implementation across all languages supported by Pip.Services toolkit and used to support dynamic data processing.

  • Constructor Details

    • TypeDescriptor

      public TypeDescriptor(String name, String library)
      Creates a new instance of the type descriptor and sets its values.
      Parameters:
      name - a name of the object type.
      library - a library or module where this object type is implemented.
  • Method Details

    • getName

      public String getName()
      Get the name of the object type.
      Returns:
      the name of the object type.
    • getLibrary

      public String getLibrary()
      Gets the name of the library or module where the object type is defined.
      Returns:
      the name of the library or module.
    • equals

      public boolean equals(Object obj)
      Compares this descriptor to a value. If the value is also a TypeDescriptor it compares their name and library fields. Otherwise this method returns false.
      Overrides:
      equals in class Object
      Parameters:
      obj - a value to compare.
      Returns:
      true if value is identical TypeDescriptor and false otherwise.
    • toString

      public String toString()
      Gets a string representation of the object. The result has format name[,library]
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.
      See Also:
    • fromString

      public static TypeDescriptor fromString(String value) throws ConfigException
      Parses a string to get descriptor fields and returns them as a Descriptor. The string must have format name[,library]
      Parameters:
      value - a string to parse.
      Returns:
      a newly created Descriptor.
      Throws:
      ConfigException - if the descriptor string is of a wrong format.
      See Also: