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