Module org.eclipse.yasson
Class PropertyOrdering
- java.lang.Object
-
- org.eclipse.yasson.internal.model.customization.PropertyOrdering
-
public class PropertyOrdering extends Object
Order properties in bean object.JsonbPropertyOrderhave always precedence. If configured withJsonbConfigprovided property order strategy will be used.
-
-
Constructor Summary
Constructors Constructor Description PropertyOrdering(Consumer<List<PropertyModel>> propertyOrderStrategy)Creates a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<PropertyModel>orderProperties(List<PropertyModel> properties, ClassModel classModel)Sorts class properties either, by classJsonbPropertyOrderannotation, or byPropertyOrderStrategyif set inJsonbConfig.
-
-
-
Constructor Detail
-
PropertyOrdering
public PropertyOrdering(Consumer<List<PropertyModel>> propertyOrderStrategy)
Creates a new instance.- Parameters:
propertyOrderStrategy- Property order strategy. Must be not null.
-
-
Method Detail
-
orderProperties
public List<PropertyModel> orderProperties(List<PropertyModel> properties, ClassModel classModel)
Sorts class properties either, by classJsonbPropertyOrderannotation, or byPropertyOrderStrategyif set inJsonbConfig.- Parameters:
properties- Properties to sort.classModel- Class model.- Returns:
- Sorted list of properties.
-
-