Class SizeAttributeComparator
java.lang.Object
de.hybris.platform.acceleratorservices.search.comparators.SizeAttributeComparator
- All Implemented Interfaces:
Comparator<String>
Comparator for size attribute of product variants.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleancheckNullValues(String value1, String value2) intprotected doubleSearches for the first double value (depends on pattern) found in given stringprotected Stringprotected Patternprotected intgetSizeSystemIndex(String value) protected booleanprotected intnumericCompare(String value1, String value2) Compares two numbersprotected IntegerprocessComplexSizeSystems(String value1, String value2, boolean value1IsNumber, boolean value2IsNumber) protected intprocessMaxSizeSystems(String value1, int value1SizeSystemIndex) protected intprocessMinSizeSystems(String value2, int value2SizeSystemIndex) protected intprocessNonNumericDistinctSystems(String value1, String value2, int value1SizeSystemIndex, int value2SizeSystemIndex) protected IntegerprocessSimpleSizeSystems(String value1, String value2) voidsetPattern(String pattern) voidsetSizeSystems(List<List<String>> sizeSystems) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
SizeAttributeComparator
public SizeAttributeComparator()
-
-
Method Details
-
compare
- Specified by:
comparein interfaceComparator<String>
-
checkNullValues
-
processSimpleSizeSystems
-
processComplexSizeSystems
-
processNonNumericDistinctSystems
-
processMaxSizeSystems
-
processMinSizeSystems
-
isNumber
- Parameters:
value- to search number in.- Returns:
- true if number can be found within given string
-
getSizeSystemIndex
- Parameters:
value- to search- Returns:
- index of first size-system containing this value, if not found -1 is returned
-
numericCompare
Compares two numbers- Parameters:
value1- first doublevalue2- second double
-
getNumber
Searches for the first double value (depends on pattern) found in given string- Parameters:
value- given string- Returns:
- first double value (depends on pattern) found in given string
-
getPattern
-
setPattern
-
getRegexPattern
-
getSizeSystems
-
setSizeSystems
-