Package org.geotools.util.factory
Class Hints.Key
- Object
-
- RenderingHints.Key
-
- Key
-
- Direct Known Subclasses:
Hints.ClassKey
,Hints.ConfigurationMetadataKey
,Hints.DoubleKey
,Hints.FileKey
,Hints.IntegerKey
,Hints.OptionKey
- Enclosing class:
- Hints
public static class Hints.Key extends RenderingHints.Key
The type for keys used to control various aspects of the factory creation. Factory creation impacts rendering (which is why extending rendering key is not a complete non-sense), but may impact other aspects of an application as well.- Since:
- 2.1
- Author:
- Martin Desruisseaux
-
-
Constructor Summary
Constructors Constructor Description Key(Class<?> classe)
Constructs a new key for values of the given class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Class<?>
getValueClass()
Returns the expected class for values stored under this key.boolean
isCompatibleValue(Object value)
Returnstrue
if the specified object is a valid value for this key.String
toString()
Returns a string representation of this key.
-
-
-
Method Detail
-
getValueClass
public Class<?> getValueClass()
Returns the expected class for values stored under this key.- Returns:
- The class of values stored under this key.
-
isCompatibleValue
public boolean isCompatibleValue(Object value)
Returnstrue
if the specified object is a valid value for this key. The default implementation checks if the specified value is an instance of the value class.Note that many hint keys defined in the
Hints
class relax this rule and acceptClass
object assignable to the expected value class as well.- Specified by:
isCompatibleValue
in classRenderingHints.Key
- Parameters:
value
- The object to test for validity.- Returns:
true
if the value is valid;false
otherwise.- See Also:
Hints.ClassKey.isCompatibleValue(java.lang.Object)
,Hints.FileKey.isCompatibleValue(java.lang.Object)
,Hints.IntegerKey.isCompatibleValue(java.lang.Object)
,Hints.OptionKey.isCompatibleValue(java.lang.Object)
-
toString
public String toString()
Returns a string representation of this key. The string representation is mostly for debugging purpose. The default implementation tries to infer the key name using reflection.- Overrides:
toString
in classObject
-
-