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
ModifierConstructorDescriptionprotected
EntityLink
(EntityLink<LinkT, EntityT, SubEntityT> toCopy) Copy constructor.EntityLink
(String fieldName) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
protected 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.int
hashCode()
final LinkT
select
(EntitySelectable<SubEntityT>... selectors) Used in combination withFluentHelperRead.select
when 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 LinkT
Returns the givenlink
in a type-safe manner.
-
Constructor Details
-
EntityLink
Copy constructor.- Parameters:
toCopy
- The link to copy.
-
EntityLink
-
-
Method Details
-
select
Used in combination withFluentHelperRead.select
when 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:EntitySelectable
Get the select expression that represents the OData entity property.- Specified by:
getSelections
in interfaceEntitySelectable<LinkT extends EntityLink<LinkT,
EntityT, SubEntityT>> - Returns:
- The serialized select terms.
-
translateLinkType
Returns the givenlink
in a type-safe manner.- Parameters:
link
- The link to cast.- Returns:
- The given
link
in 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:EntitySelectable
Get the field name of OData entity property.- Specified by:
getFieldName
in interfaceEntitySelectable<LinkT extends EntityLink<LinkT,
EntityT, SubEntityT>> - Returns:
- The field name
-