Package org.geotools.util.factory
Class Hints.IntegerKey
Object
RenderingHints.Key
Hints.Key
IntegerKey
- Enclosing class:
- Hints
A hint used to capture a configuration setting as an integer. A default value is provided and may be checked with
getDefault()
.- Since:
- 2.4
- Author:
- Jody Garnett
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Returns the default value.boolean
isCompatibleValue
(Object value) Returnstrue
if the specified object is a valid integer.int
Returns the value from the specified hints as an integer.Methods inherited from class Hints.Key
getValueClass, toString
Methods inherited from class RenderingHints.Key
equals, hashCode, intKey
-
Constructor Details
-
IntegerKey
public IntegerKey(int number) Creates a new key with the specified default value.- Parameters:
number
- The default value.
-
-
Method Details
-
getDefault
public int getDefault()Returns the default value.- Returns:
- The default value.
-
toValue
Returns the value from the specified hints as an integer. If no value were found for this key, then this method returns the default value.- Parameters:
hints
- The map where to fetch the hint value, ornull
.- Returns:
- The hint value as an integer, or the default value if not hint was explicitly set.
-
isCompatibleValue
Returnstrue
if the specified object is a valid integer.- Overrides:
isCompatibleValue
in classHints.Key
- Parameters:
value
- The object to test for validity.- Returns:
true
if the value is valid;false
otherwise.- See Also:
-