org.argkit.dung
Class AcceptableArgument<C>

java.lang.Object
  extended by org.argkit.Argument<C>
      extended by org.argkit.ArgumentDecorator<C>
          extended by org.argkit.dung.AcceptableArgument<C>
Type Parameters:
C - (Argument's) claim class
All Implemented Interfaces:
java.io.Serializable, Acceptable

public class AcceptableArgument<C>
extends ArgumentDecorator<C>
implements Acceptable

An ArgumentDecorator that implements a Boolean acceptable field. This field is implemented as Boolean (and not a boolean primitive type) so that it can be null.

The goal of this class is to be able to wrap an Argument and expose the isAcceptable method, but also to be able to provide access to additional information that sub-classes possess, hence access to the decorated Argument is provided with the getArgument method.

Author:
Matt South
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.argkit.ArgumentDecorator
argument
 
Constructor Summary
AcceptableArgument(Argument<C> argument)
           
 
Method Summary
 Argument<C> getArgument()
          Why provide access to the decorated argument? So that consumers can access the extra methods and fields of a decorated Argument subclass.
 java.lang.Boolean isAcceptable()
           
 void setAcceptable(java.lang.Boolean acceptable)
           
 java.lang.String toString()
           
 
Methods inherited from class org.argkit.ArgumentDecorator
equals, getClaim, hashCode, setClaim
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AcceptableArgument

public AcceptableArgument(Argument<C> argument)
Method Detail

isAcceptable

public java.lang.Boolean isAcceptable()
Specified by:
isAcceptable in interface Acceptable

setAcceptable

public void setAcceptable(java.lang.Boolean acceptable)

getArgument

public Argument<C> getArgument()
Why provide access to the decorated argument? So that consumers can access the extra methods and fields of a decorated Argument subclass.

Returns:
reference to decorated argument

toString

public java.lang.String toString()
Overrides:
toString in class ArgumentDecorator<C>