public abstract class AbstractStringComparator<T>
extends java.lang.Object
implements java.util.Comparator<T>
Intended usage: To allow maximum flexibility the property
setSubstitutionRules(Map)
should be set in the spring application
context.
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<java.util.regex.Pattern,java.lang.String> |
substitutionRules |
Constructor and Description |
---|
AbstractStringComparator() |
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
applySubstitutionRules(java.lang.String s)
Applies the first matching
substitutionRules set by
#setSubstitutionRules() to the given String. |
void |
setSubstitutionRules(java.util.Map<java.lang.String,java.lang.String> substitutionRules)
Set the private field substitutionRules.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
protected java.util.Map<java.util.regex.Pattern,java.lang.String> substitutionRules
public void setSubstitutionRules(java.util.Map<java.lang.String,java.lang.String> substitutionRules)
rules
- protected java.lang.String applySubstitutionRules(java.lang.String s)
substitutionRules
set by
#setSubstitutionRules()
to the given String. A rules is applied
in the following way: If the regular expression matches the given string
s
the String mapped by the regular expression is prepended
to s
.s
- Copyright © 2007-2020 EDIT. All Rights Reserved.