Class DimensionConverter
java.lang.Object
com.norconex.commons.lang.convert.AbstractConverter
com.norconex.commons.lang.convert.DimensionConverter
- All Implemented Interfaces:
Converter
Dimension converter. 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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classJSON (Jackson) deserializer using this converter.static classJSON (Jackson) serializer using this converter.static classXML (JAXB) adapter using this converter. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringnullSafeToString(Object object) protected <T> TnullSafeToType(String value, Class<T> type) Methods inherited from class com.norconex.commons.lang.convert.AbstractConverter
canEqual, equals, hashCode, toString, toString, toStringException, toStringException, toType, toTypeException, toTypeException, toUnsupportedTypeException
-
Constructor Details
-
DimensionConverter
public DimensionConverter()
-
-
Method Details
-
nullSafeToString
- Specified by:
nullSafeToStringin classAbstractConverter
-
nullSafeToType
- Specified by:
nullSafeToTypein classAbstractConverter
-