Package com.norconex.commons.lang.convert

# Class DimensionConverter

java.lang.Object
com.norconex.commons.lang.convert.AbstractConverter
com.norconex.commons.lang.convert.DimensionConverter

All Implemented Interfaces:
  `Converter`

public class DimensionConverter extends AbstractConverter

`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 Classes
  Modifier and Type
  Class
  Description
  `static class`
  `DimensionConverter.JsonDeserializer`
  JSON (Jackson) deserializer using this converter.
  `static class`
  `DimensionConverter.JsonSerializer`
  JSON (Jackson) serializer using this converter.
  `static class`
  `DimensionConverter.XmlAdapter`
  XML (JAXB) adapter using this converter.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DimensionConverter()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `protected String`
  `nullSafeToString(Object object)`
  `protected <T> T`
  `nullSafeToType(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`

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

  ### Methods inherited from interface com.norconex.commons.lang.convert.Converter

  `toString, toType`

- ## Constructor Details

  - ### DimensionConverter

    public DimensionConverter()

- ## Method Details

  - ### nullSafeToString

    protected String nullSafeToString(Object object)
    Specified by:
      `nullSafeToString` in class `AbstractConverter`

  - ### nullSafeToType

    protected <T> T nullSafeToType(String value, Class<T> type)
    Specified by:
      `nullSafeToType` in class `AbstractConverter`