Class StringBasedComparator<T>
java.lang.Object
org.tquadrat.foundation.util.internal.StringBasedComparator<T>
- Type Parameters:
T- The type of the objects to compare.
- All Implemented Interfaces:
Comparator<T>
@ClassVersion(sourceVersion="$Id: StringBasedComparator.java 1151 2025-10-01 21:32:15Z tquadrat $")
@API(status=STABLE,
since="0.1.0")
public class StringBasedComparator<T>
extends Object
implements Comparator<T>
An implementation of
Comparator
that compares object instances based on their String representation.- Author:
- Thomas Thrien (thomas.thrien@tquadrat.org)
- Version:
- $Id: StringBasedComparator.java 1151 2025-10-01 21:32:15Z tquadrat $
- Since:
- 0.1.0
- UML Diagram
-
UML Diagram for "org.tquadrat.foundation.util.internal.StringBasedComparator"
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringConverter<T> The instance ofStringConverterthat is used to translate the object instances to Strings. -
Constructor Summary
ConstructorsConstructorDescriptionStringBasedComparator(StringConverter<T> stringConverter) Creates a new instance ofStringBasedComparator. -
Method Summary
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
-
m_StringConverter
The instance ofStringConverterthat is used to translate the object instances to Strings.
-
-
Constructor Details
-
StringBasedComparator
Creates a new instance ofStringBasedComparator.- Parameters:
stringConverter- The instance ofStringConverterthat is used to translate the object instances to Strings.
-
-
Method Details
-
compare
-
