Class PropertyOrdering


  • public class PropertyOrdering
    extends Object
    Order properties in bean object. JsonbPropertyOrder have always precedence. If configured with JsonbConfig provided property order strategy will be used.
    • 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 class JsonbPropertyOrder annotation, or by PropertyOrderStrategy if set in JsonbConfig.
        Parameters:
        properties - Properties to sort.
        classModel - Class model.
        Returns:
        Sorted list of properties.