Class Order.Builder

java.lang.Object
overit.geocall.model.sorting.Order.Builder
Enclosing class:
Order

public static class Order.Builder extends Object
The Builder class is responsible for building Order objects.
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • of

      public Order.Builder of(@NotNull @NotNull String orderExpression, @NotNull @NotNull Class<?> mappingType)
      Set the builder with the raw string containing the sorting fields represented as fields of the dto.
      All the fields must be separated by a comma and present a '+' or '-' as first character to define an 'ASC' or 'DESC' order mode for the field
      Parameters:
      orderExpression - the raw string containing the sorting fields represented as fields of the dto.
      mappingType - The dto from which extract the db string inside the JsonProperty annotations
      Returns:
      A Order.Builder object.
    • addMapping

      public Order.Builder addMapping(@NotNull @NotNull String originalField, @NotNull @NotNull String targetField)
      Sets an additional mapping rule that will take precedence over any mapping with the DynO passed to the object.
      Parameters:
      originalField - The source field (represents as REST DTO's field) to map into the DB field.
      targetField - The DB field in which mapping the REST DTO's field.
      Returns:
      A Order.Builder object.
    • ignoreField

      public Order.Builder ignoreField(@NotNull @NotNull String field)
      Sets a removing mapping rule to avoid the execution of the ORDER BY clause that contains a specific DB field into the db.
      Parameters:
      field - The field for which avoid the ordering.
      Returns:
      A Order.Builder object.
    • build

      public Order build()
      Builds the order object.
      Returns:
      The Order object built.