au.com.prunge.jgenfile
Class OperationHintsCommonKeys.KeyImpl

java.lang.Object
  |
  +--au.com.prunge.jgenfile.OperationHintsCommonKeys.KeyImpl
All Implemented Interfaces:
OperationHints.Key
Enclosing class:
OperationHintsCommonKeys

public static class OperationHintsCommonKeys.KeyImpl
extends Object
implements OperationHints.Key

An simple key class.

Instances of this class must be unique since the equals and hashCode methods are not designed to be able to handle multiple instances of keys with the same name.

Version:
1.0
Author:
Peter Runge

Constructor Summary
OperationHintsCommonKeys.KeyImpl(String name, Class valueClass)
          Constructs a KeyImpl.
 
Method Summary
 boolean isCompatibleValue(OperationHints.Value value)
          Returns whether the specified value is appropriate for this key.
 String toString()
          Returns a string representation of this key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OperationHintsCommonKeys.KeyImpl

public OperationHintsCommonKeys.KeyImpl(String name,
                                        Class valueClass)
                                 throws IllegalArgumentException,
                                        NullPointerException
Constructs a KeyImpl.

Parameters:
name - the name of the key.
valueClass - the class that values must be.
Throws:
NullPointerException - if name or valueClass is null.
IllegalArgumentException - if valueClass is a class that does not implement the OperationHints.Value class.
Method Detail

isCompatibleValue

public boolean isCompatibleValue(OperationHints.Value value)
Description copied from interface: OperationHints.Key
Returns whether the specified value is appropriate for this key.

Specified by:
isCompatibleValue in interface OperationHints.Key
Parameters:
value - the value to check.
Returns:
true if the value is appropriate, false if not.
See Also:
OperationHints.Key.isCompatibleValue(au.com.prunge.jgenfile.OperationHints.Value)

toString

public String toString()
Returns a string representation of this key.

Overrides:
toString in class Object
Returns:
a string representation of this key.