Class PropertyComparator<T>
java.lang.Object
org.springframework.beans.support.PropertyComparator<T>
- Type Parameters:
T- the type of objects that may be compared by this comparator
- All Implemented Interfaces:
Comparator<T>
@Deprecated(since="7.0.3",
forRemoval=true)
public class PropertyComparator<T>
extends Object
implements Comparator<T>
Deprecated, for removal: This API element is subject to removal in a future version.
as severely outdated and superseded by more modern solutions,
for example in Spring Data Commons
PropertyComparator performs a comparison of two beans,
evaluating the specified bean property via a BeanWrapper.
- Since:
- 19.05.2003
- Author:
- Juergen Hoeller, Jean-Pierre Pawlak
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.apache.commons.logging.LogDeprecated, for removal: This API element is subject to removal in a future version. -
Constructor Summary
ConstructorsConstructorDescriptionPropertyComparator(String property, boolean ignoreCase, boolean ascending) Deprecated, for removal: This API element is subject to removal in a future version.Create a PropertyComparator for the given settings.PropertyComparator(SortDefinition sortDefinition) Deprecated, for removal: This API element is subject to removal in a future version.Create a new PropertyComparator for the given SortDefinition. -
Method Summary
Modifier and TypeMethodDescriptionintDeprecated, for removal: This API element is subject to removal in a future version.final SortDefinitionDeprecated, for removal: This API element is subject to removal in a future version.Return the SortDefinition that this comparator uses.static voidsort(Object[] source, SortDefinition sortDefinition) Deprecated, for removal: This API element is subject to removal in a future version.Sort the given source according to the given sort definition.static voidsort(List<?> source, SortDefinition sortDefinition) Deprecated, for removal: This API element is subject to removal in a future version.Sort the given List according to the given sort definition.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Field Details
-
logger
protected final org.apache.commons.logging.Log loggerDeprecated, for removal: This API element is subject to removal in a future version.
-
-
Constructor Details
-
PropertyComparator
Deprecated, for removal: This API element is subject to removal in a future version.Create a new PropertyComparator for the given SortDefinition.- See Also:
-
PropertyComparator
Deprecated, for removal: This API element is subject to removal in a future version.Create a PropertyComparator for the given settings.- Parameters:
property- the property to compareignoreCase- whether upper and lower case in String values should be ignoredascending- whether to sort ascending (true) or descending (false)
-
-
Method Details
-
getSortDefinition
Deprecated, for removal: This API element is subject to removal in a future version.Return the SortDefinition that this comparator uses. -
compare
Deprecated, for removal: This API element is subject to removal in a future version.- Specified by:
comparein interfaceComparator<T>
-
sort
Deprecated, for removal: This API element is subject to removal in a future version.Sort the given List according to the given sort definition.Note: Contained objects have to provide the given property in the form of a bean property, i.e. a getXXX method.
- Parameters:
source- the input ListsortDefinition- the parameters to sort by- Throws:
IllegalArgumentException- in case of a missing propertyNameBeansException
-
sort
Deprecated, for removal: This API element is subject to removal in a future version.Sort the given source according to the given sort definition.Note: Contained objects have to provide the given property in the form of a bean property, i.e. a getXXX method.
- Parameters:
source- input sourcesortDefinition- the parameters to sort by- Throws:
IllegalArgumentException- in case of a missing propertyNameBeansException
-