Class ItemTypeDescriptor

  • All Implemented Interfaces:
    TypeDescriptor

    public class ItemTypeDescriptor
    extends java.lang.Object
    implements TypeDescriptor

    This implementation is effectively immutable and therefore is thread safe

    Reuse this implementation through composition not inheritance

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static TypeDescriptor create​(IntegrationObjectItemModel model)  
      boolean equals​(java.lang.Object o)  
      java.util.Optional<TypeAttributeDescriptor> getAttribute​(java.lang.String attrName)
      Retrieves descriptor of the specified attribute.
      java.util.Collection<TypeAttributeDescriptor> getAttributes()
      Retrieves all attributes defined in an integration object item.
      java.lang.String getIntegrationObjectCode()
      Reads value of the integration object code.
      java.lang.String getItemCode()
      Reads value of the integration object item code.
      KeyDescriptor getKeyDescriptor()
      Retrieves key descriptor of this item type.
      java.util.List<ReferencePath> getPathsToRoot()
      Retrieves attribute path from this item type to the root item type in the same integration object.
      java.lang.String getTypeCode()
      Reads code (name) of the integration object item type in the type system.
      int hashCode()  
      boolean hasPathToRoot()
      Determines whether it's possible to navigate from an integration item described by this type descriptor to the root item of the integration object.
      boolean isEnumeration()
      Determines whether this descriptor is for a type representing type system enumeration.
      boolean isInstance​(java.lang.Object obj)
      Determines whether the specified object is an instance of the type presented by this type descriptor.
      boolean isPrimitive()
      Determines whether this descriptor is for type representing integration object item or for a primitive type.
      boolean isRoot()
      Determines whether this descriptor is for the root item in the Integration Object
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Method Detail

      • getIntegrationObjectCode

        public java.lang.String getIntegrationObjectCode()
        Description copied from interface: TypeDescriptor
        Reads value of the integration object code.
        Specified by:
        getIntegrationObjectCode in interface TypeDescriptor
        Returns:
        integration object code this item belongs to.
      • getItemCode

        public java.lang.String getItemCode()
        Description copied from interface: TypeDescriptor
        Reads value of the integration object item code.
        Specified by:
        getItemCode in interface TypeDescriptor
        Returns:
        integration object item type code. Keep in mind this value may be different from the type code of the item the integration object item represents. For example, type code of the item in the platform may be "Product" but integration object item type could be called "IntegrationProduct".
        See Also:
        TypeDescriptor.getTypeCode()
      • getTypeCode

        public java.lang.String getTypeCode()
        Description copied from interface: TypeDescriptor
        Reads code (name) of the integration object item type in the type system.
        Specified by:
        getTypeCode in interface TypeDescriptor
        Returns:
        type code of the item in the type system. Keep in mind this value may be different from the integration objec item code. For example, type code of the item in the type system may be "Product" but integration object item code may be different, e.g "IntegrationProduct".
        See Also:
        TypeDescriptor.getItemCode()
      • getAttribute

        public java.util.Optional<TypeAttributeDescriptor> getAttribute​(java.lang.String attrName)
        Description copied from interface: TypeDescriptor
        Retrieves descriptor of the specified attribute.
        Specified by:
        getAttribute in interface TypeDescriptor
        Parameters:
        attrName - name of the integration object item attribute to be retrieved. Keep in mind that name of the attribute in an integration object item may be different from the name of the corresponding attribute in the type system.
        Returns:
        attribute descriptor for the given name or Optional.empty(), if the item type does not have an attribute with such name.
      • getAttributes

        public java.util.Collection<TypeAttributeDescriptor> getAttributes()
        Description copied from interface: TypeDescriptor
        Retrieves all attributes defined in an integration object item.
        Specified by:
        getAttributes in interface TypeDescriptor
        Returns:
        a collection of all attributes in the integration object item or an empty collection, if this description is for a primitive type or the item does not have attributes.
      • isPrimitive

        public boolean isPrimitive()
        Description copied from interface: TypeDescriptor
        Determines whether this descriptor is for type representing integration object item or for a primitive type.
        Specified by:
        isPrimitive in interface TypeDescriptor
        Returns:
        true, if this descriptor is for a primitive type, e.g. Integer, String, etc; false, otherwise.
      • isEnumeration

        public boolean isEnumeration()
        Description copied from interface: TypeDescriptor
        Determines whether this descriptor is for a type representing type system enumeration.
        Specified by:
        isEnumeration in interface TypeDescriptor
        Returns:
        true, if this descriptor is for an enumeration type; false otherwise.
      • isInstance

        public boolean isInstance​(java.lang.Object obj)
        Description copied from interface: TypeDescriptor
        Determines whether the specified object is an instance of the type presented by this type descriptor.
        Specified by:
        isInstance in interface TypeDescriptor
        Parameters:
        obj - an object to evaluate.
        Returns:
        true, if the specified object is an instance of the type presented by this type descriptor; false, if the object is null or cannot be described by this type descriptor.
      • isRoot

        public boolean isRoot()
        Description copied from interface: TypeDescriptor
        Determines whether this descriptor is for the root item in the Integration Object
        Specified by:
        isRoot in interface TypeDescriptor
        Returns:
        true, if this descriptor is the root; false otherwise.
      • getKeyDescriptor

        public KeyDescriptor getKeyDescriptor()
        Description copied from interface: TypeDescriptor
        Retrieves key descriptor of this item type.
        Specified by:
        getKeyDescriptor in interface TypeDescriptor
        Returns:
        descriptor of the key identifying instances of this item 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