public final class SchemaUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CONTAINER_NAME |
static java.lang.String |
NAMESPACE |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String |
buildAssociationName(java.lang.String sourceTypeCode,
java.lang.String targetTypeCode) |
static java.util.List<AnnotationAttribute> |
createNamespaceAnnotations()
Defines new annotation attributes for things like namespaces
|
static java.util.Optional<TypeAttributeDescriptor> |
findFirstLocalizedAttribute(java.util.Collection<IntegrationObjectItemAttributeModel> attributeModels)
Finds the first localized attribute from the
Collection of attributes |
static java.lang.String |
fullyQualified(java.lang.String name)
Prepends schema name to the specified name.
|
static java.lang.String |
localizedEntityName(java.lang.String typeCode)
Returns the localized entity name
|
static <T,U> java.util.List<T> |
removeDuplicates(java.util.List<T> list,
java.util.function.Function<T,U> idFunction)
Removes duplicates from the given
List
An example usage would be:
Given a List
To remove replicates, call removeDuplicates(list, e -> e);,
where the idFunction is the element e itself. |
static FullQualifiedName |
toFullQualifiedName(java.lang.String name)
Converts specified simple schema element name to the fully qualified name.
|
public static final java.lang.String NAMESPACE
public static final java.lang.String CONTAINER_NAME
public static java.lang.String fullyQualified(java.lang.String name)
name - name of a schema element, e.g. EnityType, to be presented in a fully qualified format.java.lang.IllegalArgumentException - if the specified name is null, empty or blank.public static FullQualifiedName toFullQualifiedName(java.lang.String name)
name - name of a schema element, e.g. EntityType, to be converted.java.lang.IllegalArgumentException - if the specified name is null, empty or blank.public static java.lang.String buildAssociationName(java.lang.String sourceTypeCode,
java.lang.String targetTypeCode)
public static java.lang.String localizedEntityName(java.lang.String typeCode)
typeCode - type of the integration object itempublic static <T,U> java.util.List<T> removeDuplicates(java.util.List<T> list,
java.util.function.Function<T,U> idFunction)
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"].T - Type of the elements in the ListU - Type of the unique identifier of object Tlist - List to remove the duplicates fromidFunction - Function that returns the identifier that uniquely identifies object of type Tpublic static java.util.Optional<TypeAttributeDescriptor> findFirstLocalizedAttribute(java.util.Collection<IntegrationObjectItemAttributeModel> attributeModels)
Collection of attributesattributeModels - Collection of attributesOptional containing the TypeAttributeDescriptor if found, otherwise emptypublic static java.util.List<AnnotationAttribute> createNamespaceAnnotations()
Copyright © 2018 SAP SE. All Rights Reserved.