Class FieldOrdering<EntityT>

java.lang.Object
com.sap.cloud.sdk.datamodel.odatav4.expression.FieldOrdering<EntityT>
Type Parameters:
EntityT - The entity type that is ordered.

public class FieldOrdering<EntityT> extends Object
Represents an asc/desc ordering of an entity via a property.
  • Constructor Details

  • Method Details

    • asc

      @Nonnull public static <EntityT> FieldOrdering<EntityT> asc(@Nonnull SimpleProperty<EntityT> property)
      Creates a FieldOrdering representing an ascending order over the given property
      Type Parameters:
      EntityT - The entity the ordering is applied to.
      Parameters:
      property - The property of EntityT to be sorted in descending order.
      Returns:
      The FieldOrdering.
    • desc

      @Nonnull public static <EntityT> FieldOrdering<EntityT> desc(@Nonnull SimpleProperty<EntityT> property)
      Creates a FieldOrdering representing an descending order over the given property.
      Type Parameters:
      EntityT - The entity the ordering is applied to.
      Parameters:
      property - The property of EntityT to be sorted in descending order.
      Returns:
      The FieldOrdering.
    • toOrderExpression

      @Nullable public static OrderExpression toOrderExpression(@Nonnull FieldOrdering<?>... orderings)
      Builds an OrderExpression out of individual field orderings. The expression represents a sorting where the orderings are applied in the order they are given.
      Parameters:
      orderings - The FieldOrderings that should be applied to achieve a sorting.
      Returns:
      The resulting OrderExpression or null, if no orderings where given.
    • getProperty

      public SimpleProperty<EntityT> getProperty()
    • getOrder

      public Order getOrder()