public class InputStringToSizeTransformer extends Object implements org.apache.commons.collections.Transformer
Size object.
Size object requires Product to be set however, when we do Product#setSize(Size); the code automatically updates
the size objects related Product related fields also internally so we don't have to worry about the Product while creating the Size object.| Modifier and Type | Field and Description |
|---|---|
static String |
DIMENSION_PATTERN |
static String |
FIT_PATTERN |
| Constructor and Description |
|---|
InputStringToSizeTransformer() |
| Modifier and Type | Method and Description |
|---|---|
String |
getDefaultUnit()
If no dimensions are available and this is not null then this will be set as the default unit
|
List<String> |
getLbhOrder()
List of Name of property in
SizeDimensions. |
boolean |
isAcceptRawNonMatchingStrings()
If true will accept any input as
SizeString else throw an exception if it cannot categorize it as SizeFit or SizeDimensions |
boolean |
isSpecifyDims()
If true, will need the dimensions to be specified within the input
|
void |
setAcceptRawNonMatchingStrings(boolean acceptRawNonMatchingStrings)
If true will accept any input as
SizeString else throw an exception if it cannot categorize it as SizeFit or SizeDimensions |
void |
setDefaultUnit(String defaultUnit)
If no dimensions are available and this is not null then this will be set as the default unit
|
void |
setLbhOrder(List<String> lbhOrder)
List of Name of property in
SizeDimensions. |
void |
setSpecifyDims(boolean specifyDims)
If true, will need the dimensions to be specified within the input
|
Object |
transform(Object input) |
public static final String DIMENSION_PATTERN
public static final String FIT_PATTERN
public Object transform(Object input)
transform in interface org.apache.commons.collections.Transformerpublic boolean isSpecifyDims()
public void setSpecifyDims(boolean specifyDims)
public String getDefaultUnit()
public void setDefaultUnit(String defaultUnit)
public List<String> getLbhOrder()
SizeDimensions. Example {"length", "width", "height"}
(L)ength x (W)idth x (H)eight order
Positions are from 0 to 2. (Size will be 3)
public void setLbhOrder(List<String> lbhOrder)
SizeDimensions. Example {"length", "width", "height"}
(L)ength x (W)idth x (H)eight order
Positions are from 0 to 2. (Size will be 3)
public boolean isAcceptRawNonMatchingStrings()
SizeString else throw an exception if it cannot categorize it as SizeFit or SizeDimensionspublic void setAcceptRawNonMatchingStrings(boolean acceptRawNonMatchingStrings)
SizeString else throw an exception if it cannot categorize it as SizeFit or SizeDimensionsCopyright © 2018. All rights reserved.