Class PropertyOrdering


  • public class PropertyOrdering
    extends java.lang.Object
    Order properties in bean object. JsonbPropertyOrder have always precedence. If configured with JsonbConfig provided property order strategy will be used.
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertyOrdering​(java.util.function.Consumer<java.util.List<PropertyModel>> propertyOrderStrategy)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<PropertyModel> orderProperties​(java.util.List<PropertyModel> properties, ClassModel classModel)
      Sorts class properties either, by class JsonbPropertyOrder annotation, or by PropertyOrderStrategy if set in JsonbConfig.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PropertyOrdering

        public PropertyOrdering​(java.util.function.Consumer<java.util.List<PropertyModel>> propertyOrderStrategy)
        Creates a new instance.
        Parameters:
        propertyOrderStrategy - Property order strategy. Must be not null.
    • Method Detail

      • orderProperties

        public java.util.List<PropertyModel> orderProperties​(java.util.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.