Class DimensionConverter
- java.lang.Object
-
- com.norconex.commons.lang.convert.AbstractConverter
-
- com.norconex.commons.lang.convert.DimensionConverter
-
- All Implemented Interfaces:
IConverter
public class DimensionConverter extends AbstractConverter
Dimensionconverter. Converted as strings by joining width and height with an "x" (e.g., 640x480). The conversion from strings supports many formats, as long as two numeric groups are present (width and height, respectively). If more than two groups of digits, only the first two are kept. If only one value is present, it is used for both width and height. Examples of supported formats:- 640x480
- 640 480
- width:640, height:480
- aaa640bbb480ccc100
- 1200
- size:1200px
- Since:
- 2.0.0
-
-
Constructor Summary
Constructors Constructor Description DimensionConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringnullSafeToString(Object object)protected <T> TnullSafeToType(String value, Class<T> type)-
Methods inherited from class com.norconex.commons.lang.convert.AbstractConverter
equals, hashCode, toString, toString, toStringException, toStringException, toType, toTypeException, toTypeException, toUnsupportedTypeException
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.norconex.commons.lang.convert.IConverter
toString, toType
-
-
-
-
Method Detail
-
nullSafeToString
protected String nullSafeToString(Object object)
- Specified by:
nullSafeToStringin classAbstractConverter
-
nullSafeToType
protected <T> T nullSafeToType(String value, Class<T> type)
- Specified by:
nullSafeToTypein classAbstractConverter
-
-