com.acsinet_solutions.cetia4.data
Class SimpleIntKeyDTO

java.lang.Object
  extended by com.acsinet_solutions.cetia4.data.SimpleIntKeyDTO
All Implemented Interfaces:
IntKeyDTO, java.io.Serializable, java.lang.Comparable<IntKeyDTO>

public class SimpleIntKeyDTO
extends java.lang.Object
implements IntKeyDTO, java.io.Serializable

Simple implementation of the IntKeyDTO interface

Derechos Reservados

Author:
Santiago Arriaga
See Also:
Serialized Form

Constructor Summary
SimpleIntKeyDTO()
          Default required constructor
SimpleIntKeyDTO(java.lang.Integer id)
          Convenience constructor
 
Method Summary
 int compareTo(IntKeyDTO obj)
          Overridable comparator method.
 SimpleIntKeyDTO copy()
          Get a serialized copy of this object
 boolean equals(java.lang.Object obj)
          equals() contract; as these are persistible objects, id comparison must suffice
 int getId()
          Returns the id.
 int getVersion()
          Returns the version.
 int hashCode()
          hashCode() contract
 void setId(int id)
          Sets the id.
 void setVersion(int version)
          Sets the version.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleIntKeyDTO

public SimpleIntKeyDTO()
Default required constructor


SimpleIntKeyDTO

public SimpleIntKeyDTO(java.lang.Integer id)
Convenience constructor

Method Detail

getId

public int getId()
Returns the id.

Specified by:
getId in interface IntKeyDTO
Returns:
int

getVersion

public int getVersion()
Returns the version.

Specified by:
getVersion in interface IntKeyDTO
Returns:
int

setId

public void setId(int id)
Sets the id.

Specified by:
setId in interface IntKeyDTO
Parameters:
id - The id to set

setVersion

public void setVersion(int version)
Sets the version.

Specified by:
setVersion in interface IntKeyDTO
Parameters:
version - The version to set

copy

public SimpleIntKeyDTO copy()
Get a serialized copy of this object

Specified by:
copy in interface IntKeyDTO

equals

public boolean equals(java.lang.Object obj)
equals() contract; as these are persistible objects, id comparison must suffice

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
hashCode() contract

Overrides:
hashCode in class java.lang.Object

compareTo

public int compareTo(IntKeyDTO obj)
Overridable comparator method. This comparation is based on ids, and only applies for objects sharing exactly the same class.

Specified by:
compareTo in interface java.lang.Comparable<IntKeyDTO>
See Also:
Comparable.compareTo(Object)