org.jplate.kvp.impl.defaults
Class DefaultKvp

java.lang.Object
  extended by org.jplate.kvp.impl.defaults.DefaultKvp
All Implemented Interfaces:
FormattableIfc, KvpIfc

public class DefaultKvp
extends java.lang.Object
implements KvpIfc

Default implementation of a KvpIfc.

Modifications:
    $Date: 2008-12-02 12:32:45 -0500 (Tue, 02 Dec 2008) $
    $Revision: 479 $
    $Author: sfloess $
    $HeadURL: https://jplate.svn.sourceforge.net/svnroot/jplate/trunk/src/dev/java/org/jplate/kvp/impl/defaults/DefaultKvp.java $
    


Field Summary
private  java.lang.String _key
          Holds the key.
private  org.apache.commons.logging.Log _log
          Used for logging.
private  java.lang.String _value
          Holds the value.
 
Constructor Summary
DefaultKvp()
          Default constructor.
DefaultKvp(DefaultKvp toCopy)
          Copy constructor.
DefaultKvp(KvpIfc toCopy)
          Copy constructor.
 
Method Summary
 boolean equals(java.lang.Object toCompare)
          
 java.lang.String getKey()
          Returns the key.
 java.lang.String getValue()
          Returns the value.
 int hashCode()
          
 void setKey(java.lang.String key)
          Sets the key.
 void setValue(java.lang.String value)
          Sets the value.
 java.lang.String toString()
          
 java.lang.String toString(java.lang.String prepend)
          Returns a string representation of self prepending prepend to each line.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_log

private final transient org.apache.commons.logging.Log _log
Used for logging.


_key

private java.lang.String _key
Holds the key.


_value

private java.lang.String _value
Holds the value.

Constructor Detail

DefaultKvp

public DefaultKvp(DefaultKvp toCopy)
Copy constructor.

Parameters:
toCopy - The object to copy.

DefaultKvp

public DefaultKvp(KvpIfc toCopy)
Copy constructor.

Parameters:
toCopy - The object to copy.

DefaultKvp

public DefaultKvp()
Default constructor.

Method Detail

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

equals

public boolean equals(java.lang.Object toCompare)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString(java.lang.String prepend)
Returns a string representation of self prepending prepend to each line.

Specified by:
toString in interface FormattableIfc
Parameters:
prepend - The text to prepend to each line as defined in the return value.
Returns:
A string representation of self who has prepend prepended to each line.

getKey

public java.lang.String getKey()
Returns the key.

Specified by:
getKey in interface KvpIfc
Returns:
the key.

setKey

public void setKey(java.lang.String key)
Sets the key.

Specified by:
setKey in interface KvpIfc
Parameters:
key - The new key.

getValue

public java.lang.String getValue()
Returns the value.

Specified by:
getValue in interface KvpIfc
Returns:
the value.

setValue

public void setValue(java.lang.String value)
Sets the value.

Specified by:
setValue in interface KvpIfc
Parameters:
value - The new value.