Class EntityLink<LinkT extends EntityLink<LinkT,EntityT,SubEntityT>,EntityT extends VdmObject<?>,SubEntityT extends VdmObject<?>>
java.lang.Object
com.sap.cloud.sdk.datamodel.odata.helper.EntityLink<LinkT,EntityT,SubEntityT>
- Type Parameters:
LinkT- The type of this link.EntityT- The type of the entity.SubEntityT- The type of the subentity.
- All Implemented Interfaces:
EntitySelectable<EntityT>
public class EntityLink<LinkT extends EntityLink<LinkT,EntityT,SubEntityT>,EntityT extends VdmObject<?>,SubEntityT extends VdmObject<?>>
extends Object
implements EntitySelectable<EntityT>
Helper class for representing links (navigation properties) between entities.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntityLink(EntityLink<LinkT, EntityT, SubEntityT> toCopy) Copy constructor.EntityLink(String fieldName) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanbooleanprotected ExpressionFluentHelper<EntityT>filterOnOneToOneLink(ExpressionFluentHelper<SubEntityT> filterExpression) Add a filter expression on a single navigation property.Returns a list of expansions for this link.Get the field name of OData entity property.Get the select expression that represents the OData entity property.inthashCode()final LinkTselect(EntitySelectable<SubEntityT>... selectors) Used in combination withFluentHelperRead.selectwhen expanding a navigation property to specify which fields of that navigation property to select, and which navigation properties of that navigation property to expand.toString()protected LinkTReturns the givenlinkin a type-safe manner.
-
Constructor Details
-
EntityLink
Copy constructor.- Parameters:
toCopy- The link to copy.
-
EntityLink
-
-
Method Details
-
select
Used in combination withFluentHelperRead.selectwhen expanding a navigation property to specify which fields of that navigation property to select, and which navigation properties of that navigation property to expand.- Parameters:
selectors- Array of fields to select and/or navigation properties to expand.- Returns:
- Selector for
FluentHelperRead.select.
-
getExpansions
Returns a list of expansions for this link.- Returns:
- A list of expansions for this link.
-
getSelections
Description copied from interface:EntitySelectableGet the select expression that represents the OData entity property.- Specified by:
getSelectionsin interfaceEntitySelectable<LinkT extends EntityLink<LinkT,EntityT, SubEntityT>> - Returns:
- The serialized select terms.
-
translateLinkType
Returns the givenlinkin a type-safe manner.- Parameters:
link- The link to cast.- Returns:
- The given
linkin a type-safe manner.
-
filterOnOneToOneLink
@Nonnull protected ExpressionFluentHelper<EntityT> filterOnOneToOneLink(@Nonnull ExpressionFluentHelper<SubEntityT> filterExpression) Add a filter expression on a single navigation property.- Parameters:
filterExpression- The filter to apply.- Returns:
- A new expression builder that includes the given filter.
-
toString
-
equals
-
canEqual
-
hashCode
public int hashCode() -
getFieldName
Description copied from interface:EntitySelectableGet the field name of OData entity property.- Specified by:
getFieldNamein interfaceEntitySelectable<LinkT extends EntityLink<LinkT,EntityT, SubEntityT>> - Returns:
- The field name
-