java.lang.Object
de.hybris.platform.odata2services.odata.schema.utils.SchemaUtils

public final class SchemaUtils extends Object
  • Field Details

  • Method Details

    • fullyQualified

      public static String fullyQualified(String name)
      Prepends schema name to the specified name.
      Parameters:
      name - name of a schema element, e.g. EnityType, to be presented in a fully qualified format.
      Returns:
      string presentation of the fully qualified name.
      Throws:
      IllegalArgumentException - if the specified name is null, empty or blank.
    • toFullQualifiedName

      public static org.apache.olingo.odata2.api.edm.FullQualifiedName toFullQualifiedName(String name)
      Converts specified simple schema element name to the fully qualified name.
      Parameters:
      name - name of a schema element, e.g. EntityType, to be converted.
      Returns:
      fully qualified name.
      Throws:
      IllegalArgumentException - if the specified name is null, empty or blank.
    • buildAssociationName

      public static String buildAssociationName(String sourceTypeCode, String targetTypeCode)
    • localizedEntityName

      public static String localizedEntityName(String typeCode)
      Returns the localized entity name
      Parameters:
      typeCode - type of the integration object item
      Returns:
      localized entity name
    • removeDuplicates

      public static <T, U> List<T> removeDuplicates(List<T> list, Function<T,U> idFunction)
      Removes duplicates from the given List An example usage would be: Given a List list = Arrays.asList("a", "b", "a"); To remove replicates, call removeDuplicates(list, e -> e);, where the idFunction is the element e itself. The resulting list would be ["a", "b"].
      Type Parameters:
      T - Type of the elements in the List
      U - Type of the unique identifier of object T
      Parameters:
      list - List to remove the duplicates from
      idFunction - Function that returns the identifier that uniquely identifies object of type T
      Returns:
      List of type T with duplicates removed
    • findFirstLocalizedAttribute

      @Deprecated(since="2205", forRemoval=true) public static Optional<TypeAttributeDescriptor> findFirstLocalizedAttribute(Collection<IntegrationObjectItemAttributeModel> attributeModels)
      Deprecated, for removal: This API element is subject to removal in a future version.
      switch to use TypeAttributeDescriptor instead of the IntegrationObjectItemAttributeModel selecting localized attributes is trivial with TypeAttributeDescriptor through the usage of the TypeAttributeDescriptor.isLocalized() method.
      Finds the first localized attribute from the Collection of attributes
      Parameters:
      attributeModels - Collection of attributes
      Returns:
      An Optional containing the TypeAttributeDescriptor if found, otherwise empty
    • createNamespaceAnnotations

      public static List<org.apache.olingo.odata2.api.edm.provider.AnnotationAttribute> createNamespaceAnnotations()
      Defines new annotation attributes for things like namespaces
      Returns:
      the newly defined annotation attributes