Class ODataSchema
- java.lang.Object
-
- de.hybris.platform.odata2services.odata.ODataSchema
-
public class ODataSchema extends java.lang.ObjectA helper class for exploring and evaluating content of an ODataSchemaobject.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsAssociationBetween(java.lang.String type1, java.lang.String type2)static ODataSchemafrom(org.apache.olingo.odata2.api.edm.provider.Schema schema)org.apache.olingo.odata2.api.edm.provider.AssociationgetAssociation(java.lang.String name)java.util.Collection<org.apache.olingo.odata2.api.edm.provider.Association>getAssociations()ODataEntityContainergetDefaultEntityContainer()Retrieves default entity container in this schema content.ODataEntityTypegetEntityType(java.lang.String type)Retrieves an entity type defined in this schema.java.util.Collection<java.lang.String>getEntityTypeNames()Retrieves names of all entity types defined in this schema.booleanisEmpty()Checks whether content of this schema is empty.
-
-
-
Method Detail
-
from
public static ODataSchema from(org.apache.olingo.odata2.api.edm.provider.Schema schema)
-
isEmpty
public boolean isEmpty()
Checks whether content of this schema is empty.- Returns:
true, if this schema has empty content;false, if at least one element (XML element) is found in the schema content.
-
getEntityTypeNames
public java.util.Collection<java.lang.String> getEntityTypeNames()
Retrieves names of all entity types defined in this schema.- Returns:
- a collection of all entity type names present in this schema or an empty collection, if this schema does not contain a single entity type.
-
getEntityType
public ODataEntityType getEntityType(java.lang.String type)
Retrieves an entity type defined in this schema.- Parameters:
type- name of the type to retrieve- Returns:
- entity type matching the type name.
- Throws:
java.lang.IllegalArgumentException- if the specified type does not exist in this schema.
-
containsAssociationBetween
public boolean containsAssociationBetween(java.lang.String type1, java.lang.String type2)
-
getAssociation
public org.apache.olingo.odata2.api.edm.provider.Association getAssociation(java.lang.String name)
-
getAssociations
public java.util.Collection<org.apache.olingo.odata2.api.edm.provider.Association> getAssociations()
-
getDefaultEntityContainer
public ODataEntityContainer getDefaultEntityContainer()
Retrieves default entity container in this schema content.- Returns:
- the default entity container or
null, if default entity container is not present.
-
-