Package overit.geocall.model.sorting
Class Order.Builder
java.lang.Object
overit.geocall.model.sorting.Order.Builder
- Enclosing class:
Order
The Builder class is responsible for building Order objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddMapping(@NotNull String originalField, @NotNull String targetField) Sets an additional mapping rule that will take precedence over any mapping with theDynOpassed to the object.build()Builds the order object.ignoreField(@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.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
-
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.Builderobject.
-
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 theDynOpassed 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.Builderobject.
-
ignoreField
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.Builderobject.
-
build
Builds the order object.- Returns:
- The
Orderobject built.
-