org.marketcetera.util.auth
Class Holder<T>

java.lang.Object
  extended by org.marketcetera.util.auth.Holder<T>
Direct Known Subclasses:
HolderCharArray

public class Holder<T>
extends Object

A holder of a piece of data.

Since:
0.5.0
Version:
$Id: Holder.java 16154 2012-07-14 16:34:05Z colin $
Author:
tlerios@marketcetera.com

Constructor Summary
Holder()
          Creates a new holder which does not require its data to be set during authentication.
Holder(I18NBoundMessage message)
          Creates a new holder.
 
Method Summary
 I18NBoundMessage getMessage()
          Returns the receiver's optional data-not-set message.
 T getValue()
          Returns the receiver's data.
 boolean isSet()
          Checks whether the receiver's data is set.
 void setValue(T value)
          Sets the receiver's data to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Holder

public Holder(I18NBoundMessage message)
Creates a new holder. If the given message is non-null, the holder requires that its data is set during authentication; if the data is not set, the message is logged.

Parameters:
message - The data-not-set message. It may be null if the holder's data is optional and may remain unset.

Holder

public Holder()
Creates a new holder which does not require its data to be set during authentication.

Method Detail

setValue

public void setValue(T value)
Sets the receiver's data to the given value.

Parameters:
value - The value, which may be null to unset the receiver's data.

getValue

public T getValue()
Returns the receiver's data.

Returns:
The data, which is null if the receiver's data is not set.

isSet

public boolean isSet()
Checks whether the receiver's data is set.

Returns:
True if so.

getMessage

public I18NBoundMessage getMessage()
Returns the receiver's optional data-not-set message.

Returns:
The message, which is null if the receiver's data is optional.


Copyright © 2012. All Rights Reserved.