Class EntityField<EntityT,FieldT>

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.helper.EntityField<EntityT,FieldT>
Type Parameters:
EntityT - VdmObject that the field belongs to
FieldT - Field type
All Implemented Interfaces:
EntitySelectable<EntityT>

public class EntityField<EntityT,FieldT> extends Object implements EntitySelectable<EntityT>
Template class to represent entity fields. Instances of this object are used in query modifier methods of the entity fluent helpers. Contains methods to compare a field's value with a provided value. Use the constants declared in each entity inner class. Instantiating directly requires knowing the underlying OData field names, so use the constructor with caution.
  • Constructor Details

    • EntityField

      public EntityField(@Nonnull String fieldName)
      Use the constants declared in each entity inner class. Instantiating directly requires knowing the underlying OData field names, so use with caution.
      Parameters:
      fieldName - OData field name. Must match the field returned by the underlying OData service.
    • EntityField

      public EntityField(@Nonnull String fieldName, @Nullable TypeConverter<FieldT,?> typeConverter)
      Use the constants declared in each entity inner class. Instantiating directly requires knowing the underlying OData field names, so use with caution. When creating instances for custom fields, this constructor can be used to add a type converter that will be automatically used by the respective entity when getting or setting custom fields.
      Parameters:
      fieldName - OData field name. Must match the field returned by the underlying OData service.
      typeConverter - An implementation of a TypeConverter. The first type must match FieldT, the second type must match the type Olingo returns.
  • Method Details

    • eqNull

      @Nonnull public ExpressionFluentHelper<EntityT> eqNull()
      Equals-null expression fluent helper.
      Returns:
      Fluent helper that represents a field == null expression.
    • eq

      @Nonnull public ExpressionFluentHelper<EntityT> eq(@Nullable FieldT value)
      Equals expression fluent helper.
      Parameters:
      value - Field value to compare with.
      Returns:
      Fluent helper that represents a field == value expression.
    • neNull

      @Nonnull public ExpressionFluentHelper<EntityT> neNull()
      Not equals-null expression fluent helper.
      Returns:
      Fluent helper that represents a field != null expression.
    • ne

      @Nonnull public ExpressionFluentHelper<EntityT> ne(@Nullable FieldT value)
      Not equals expression fluent helper.
      Parameters:
      value - Field value to compare with.
      Returns:
      Fluent helper that represents a field != value expression.
    • gt

      @Nonnull public ExpressionFluentHelper<EntityT> gt(@Nullable FieldT value)
      Greater than expression fluent helper.
      Parameters:
      value - Field value to compare with.
      Returns:
      Fluent helper that represents a field > value expression.
    • ge

      @Nonnull public ExpressionFluentHelper<EntityT> ge(@Nullable FieldT value)
      Greater than or equals expression fluent helper.
      Parameters:
      value - Field value to compare with.
      Returns:
      Fluent helper that represents a field >= value expression.
    • lt

      @Nonnull public ExpressionFluentHelper<EntityT> lt(@Nullable FieldT value)
      Less than expression fluent helper.
      Parameters:
      value - Field value to compare with.
      Returns:
      Fluent helper that represents a field < value expression.
    • le

      @Nonnull public ExpressionFluentHelper<EntityT> le(@Nullable FieldT value)
      Less than or equals expression fluent helper.
      Parameters:
      value - Field value to compare with.
      Returns:
      Fluent helper that represents a field <= value expression.
    • substringOf

      @Nonnull public ExpressionFluentHelper<EntityT> substringOf(@Nonnull String value)
      Expression fluent helper supporting the filter function "substringof".
      Parameters:
      value - value String value to apply the function on
      Returns:
      Fluent helper that represents a substringof(value,field) expression
    • endsWith

      @Nonnull public ExpressionFluentHelper<EntityT> endsWith(@Nonnull String value)
      Expression fluent helper supporting the filter function "endswith".
      Parameters:
      value - String value to apply the function on
      Returns:
      Fluent helper that represents a endswith(field,value) expression
    • startsWith

      @Nonnull public ExpressionFluentHelper<EntityT> startsWith(@Nonnull String value)
      Expression fluent helper supporting the filter function "startswith".
      Parameters:
      value - String value to apply the function on
      Returns:
      Fluent helper that represents a startswith(field,value) expression
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(@Nullable Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getFieldName

      @Nonnull public String getFieldName()
      Description copied from interface: EntitySelectable
      Get the field name of OData entity property.
      Specified by:
      getFieldName in interface EntitySelectable<EntityT>
      Returns:
      The field name
    • getTypeConverter

      @Nullable public TypeConverter<FieldT,?> getTypeConverter()