Class NativeFieldKeySorter
- java.lang.Object
-
- com.thoughtworks.xstream.converters.reflection.NativeFieldKeySorter
-
- All Implemented Interfaces:
FieldKeySorter
public class NativeFieldKeySorter extends java.lang.Object implements FieldKeySorter
Sort the fields in their natural order. Fields are returned in their declaration order, fields of base classes first.- Since:
- 1.2.2
-
-
Constructor Summary
Constructors Constructor Description NativeFieldKeySorter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map
sort(java.lang.Class type, java.util.Map keyedByFieldKey)
Sort the fields of a type.
-
-
-
Method Detail
-
sort
public java.util.Map sort(java.lang.Class type, java.util.Map keyedByFieldKey)
Description copied from interface:FieldKeySorter
Sort the fields of a type. The method will be called with the class type that contains all the fields and a Map that retains the order in which the elements have been added. The sequence in which elements are returned by an iterator defines the processing order of the fields. An implementation may create a different Map with similar semantic, add all elements of the original map and return the new one.- Specified by:
sort
in interfaceFieldKeySorter
- Parameters:
type
- the class that contains all the fieldskeyedByFieldKey
- a Map containing aFieldKey
as key element and aField
as value.- Returns:
- a Map with all the entries of the original Map
-
-