java.lang.Object
de.hybris.platform.integrationservices.util.files.ItemType

public class ItemType extends Object
Representation of an item type in the type system. This representation is generic and does not distinguish between types of an item, e.g. a collection item type, a composed item type, an enum type, etc.
  • Method Details

    • create

      public static ItemType create(@NotNull @NotNull Element el)
      Creates an item type other than ComposedType, such as an enum or a map.
      Parameters:
      el - XML element containing the item type configuration
    • create

      public static ItemType create(@NotNull @NotNull Element el, TypeService service)
      Creates an instance of a ComposedType item.
      Parameters:
      el - XML element containing the item type configuration
      service - instance of the type service to query about the item type hierarchy.
    • getTypeCode

      public String getTypeCode()
      Retrieves type code of this item type.
      Returns:
      a code that identifies this item type.
    • isCreated

      public boolean isCreated()
      Determines whether this item type is created by the context items.xml or it was created in a different file and simply acquired more attributes or relations in the context items.xml. The implementation assumes that, if the item type definition does not contain "autocreate" attribute then it's by default is true or, otherwise, it takes the attribute value to determine whether the file creates this type or not.
      Returns:
      true if this item type is created in the context items.xml; false otherwise.
    • withAttributes

      public ItemType withAttributes(Collection<String> attributes)
      Adds attributes to this item type.
      Parameters:
      attributes - a collection of attribute names present in this item type
      Returns:
      an item type with the attributes added.
    • withAttribute

      public ItemType withAttribute(String attribute)
      Adds an attribute to this item type.
      Parameters:
      attribute - name of an attribute present in this item type
      Returns:
      an item type with the attribute added.
    • getAttributes

      public Collection<String> getAttributes()
      Retrieves attributes explicitly defined in this item type within the context items.xml file.
      Returns:
      attributes for this item type defined in items.xml file, from which this item type was derived. Inherited attributes defined in other items.xml files are excluded. If this item type does not contain attributes, then an empty collection is returned.
      See Also:
    • getInheritedItems

      public Collection<ItemType> getInheritedItems()
      Retrieves a collection of all item types this type inherits from in the type system.
      Returns:
      a collection of all supertypes for this item type or an empty collection, if this item type does not extend any other type or, if this type does not represent the ComposedType in the type system.
    • containsAttribute

      public boolean containsAttribute(String name)
      Checks whether this item type contains an attribute with the specified name. The name is case-insensitive.
      Parameters:
      name - name of the attribute to check for presence in this item type.
      Returns:
      true, if this item type contains the specified attribute regardless of the letter case match; false otherwise.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object