SPT Core API

com.sptci.jdo
Class NameDescription

java.lang.Object
  extended by com.sptci.jdo.JDOObject
      extended by com.sptci.jdo.NameDescription
All Implemented Interfaces:
Serializable, Cloneable, Comparable<JDOObject>, javax.jdo.InstanceCallbacks, javax.jdo.listener.ClearCallback, javax.jdo.listener.DeleteCallback, javax.jdo.listener.LoadCallback, javax.jdo.listener.StoreCallback
Direct Known Subclasses:
Category, Group

public abstract class NameDescription
extends JDOObject

A JavaBean that represents a simple name and description pair. This may be used as the base class for a number of data types that represent similar data. This object will be enhanced by a JDO byte code enhancer to convert into a persistence aware object.

© Copyright 2006, Sans Pareil Technologies, Inc.

Version:
$Id: NameDescription.java 4618 2009-02-10 00:49:30Z rakesh $
Author:
Rakesh Vidyadharan 2006-03-13
See Also:
Serialized Form

Field Summary
protected  String description
          A textual description for the name.
protected  String name
          The name fulfilled by the person.
 
Fields inherited from class com.sptci.jdo.JDOObject
hash, HASH, logger, startLetter
 
Constructor Summary
protected NameDescription()
          Default constructor.
  NameDescription(String name)
          Create a new instance of the class with the specified values.
  NameDescription(String name, String description)
          Create a new instance of the class with the specified values.
 
Method Summary
 int compareTo(JDOObject object)
          Compares this object with the specified object for order.
protected static XStream createXStream()
          Return the utility used to convert the object to and from XML representation.
 boolean equals(Object object)
          Compare the specified object with this object for equality.
 String getDescription()
          Returns description.
 String getName()
          Returns name.
 int hashCode()
          Return a hash code for this object.
 void setDescription(String description)
          Set description.
 void setName(String name)
          Set name.
 
Methods inherited from class com.sptci.jdo.JDOObject
clone, fromXML, getObjectId, getPersistenceManager, getStartLetter, jdoPostLoad, jdoPreClear, jdoPreDelete, jdoPreStore, resetHash, toString, toXML
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected String name
The name fulfilled by the person.


description

protected String description
A textual description for the name.

Constructor Detail

NameDescription

protected NameDescription()
Default constructor.


NameDescription

public NameDescription(String name)
Create a new instance of the class with the specified values. Calls NameDescription( String, String ) with a value of null for description.

Parameters:
name - The name value to set.

NameDescription

public NameDescription(String name,
                       String description)
Create a new instance of the class with the specified values.

Parameters:
name - The name value to set.
description - The description value to set.
Method Detail

createXStream

protected static XStream createXStream()
Return the utility used to convert the object to and from XML representation. This method must be used by the JDOObject.toXML() and JDOObject.fromXML(java.lang.String) methods to initialise the serialiser in a standard manner.

Returns:
The XML serialiser to use.

equals

public boolean equals(Object object)
Compare the specified object with this object for equality. Returns true if the specified object is of the same type as this object, and the values of all the fields match.

Overrides:
equals in class JDOObject
Parameters:
object - The object that is to compared with this object.
Returns:
boolean Returns true if the objects have the same field values.

hashCode

public int hashCode()
Return a hash code for this object. Returns a hash code derived from the class fields.

Overrides:
hashCode in class JDOObject
Returns:
The hash code for this object.

compareTo

public int compareTo(JDOObject object)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

Compare the values of name

Specified by:
compareTo in interface Comparable<JDOObject>
Overrides:
compareTo in class JDOObject
Parameters:
object - The object that is to be compared with this object.
Returns:
int A negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.

getName

public String getName()
Returns name.

Returns:
String The value/reference of/to name.

setName

public void setName(String name)
Set name.

Parameters:
name - The value to set.

getDescription

public String getDescription()
Returns description.

Returns:
String The value/reference of/to description.

setDescription

public void setDescription(String description)
Set description.

Parameters:
description - The value to set.

SPT Core API