Package com.unboundid.scim2.server.utils
Class ResourceComparator<T extends ScimResource>
- java.lang.Object
-
- com.unboundid.scim2.server.utils.ResourceComparator<T>
-
- All Implemented Interfaces:
Comparator<T>
public class ResourceComparator<T extends ScimResource> extends Object implements Comparator<T>
A comparator implementation that could be used to compare POJOs representing SCIM resources using the SCIM sorting parameters.
-
-
Constructor Summary
Constructors Constructor Description ResourceComparator(Path sortBy, SortOrder sortOrder, ResourceTypeDefinition resourceType)Create a new ScimComparator.ResourceComparator(Path sortBy, ResourceTypeDefinition resourceType)Create a new ScimComparator that will sort in ascending order.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompare(T o1, T o2)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
-
-
-
Constructor Detail
-
ResourceComparator
public ResourceComparator(@NotNull Path sortBy, @Nullable ResourceTypeDefinition resourceType)
Create a new ScimComparator that will sort in ascending order.- Parameters:
sortBy- The path to the attribute to sort by.resourceType- The resource type definition containing the schemas ornullto compare using case insensitive matching for string values.
-
ResourceComparator
public ResourceComparator(@NotNull Path sortBy, @Nullable SortOrder sortOrder, @Nullable ResourceTypeDefinition resourceType)
Create a new ScimComparator.- Parameters:
sortBy- The path to the attribute to sort by.sortOrder- The sort order.resourceType- The resource type definition containing the schemas ornullto compare using case insensitive matching for string values.
-
-
Method Detail
-
compare
public int compare(@NotNull T o1, @NotNull T o2)
- Specified by:
comparein interfaceComparator<T extends ScimResource>
-
-