org.teleal.cling.model.types
Class IntegerDatatype
java.lang.Object
org.teleal.cling.model.types.AbstractDatatype<Integer>
org.teleal.cling.model.types.IntegerDatatype
- All Implemented Interfaces:
- Datatype<Integer>
public class IntegerDatatype
- extends AbstractDatatype<Integer>
Although the UDA 1.0 spec doesn't say it, we assume that "int" is a 4 byte regular Java integer.
- Author:
- Christian Bauer
IntegerDatatype
public IntegerDatatype(int byteSize)
valueOf
public Integer valueOf(String s)
throws InvalidValueException
- Description copied from interface:
Datatype
- Transforms a string representation into a value of the supported type.
- Parameters:
s
- The string representation of a value.
- Returns:
- The converted value or
null
if the string was null
or empty.
- Throws:
InvalidValueException
- If the string couldn't be parsed.
isValid
public boolean isValid(Integer value)
- Specified by:
isValid
in interface Datatype<Integer>
- Overrides:
isValid
in class AbstractDatatype<Integer>
- Parameters:
value
- The value to validate or null
.
- Returns:
- Returns
true
if the value was null
, validation result otherwise.
getMinValue
public int getMinValue()
getMaxValue
public int getMaxValue()
getByteSize
public int getByteSize()
Copyright © 2010 Teleal GmbH, Switzerland. All Rights Reserved.