Spring Data Commons

org.springframework.data.history
Class Revision<N extends Number & Comparable<N>,T>

java.lang.Object
  extended by org.springframework.data.history.Revision<N,T>
All Implemented Interfaces:
Comparable<Revision<N,?>>

public final class Revision<N extends Number & Comparable<N>,T>
extends Object
implements Comparable<Revision<N,?>>

Wrapper to contain RevisionMetadata as well as the revisioned entity.

Author:
Oliver Gierke, Philipp Huegelmeyer

Constructor Summary
Revision(RevisionMetadata<? extends N> metadata, T entity)
          Creates a new Revision consisting of the given RevisionMetadata and entity.
 
Method Summary
 int compareTo(Revision<N,?> that)
           
 boolean equals(Object obj)
           
 T getEntity()
          Returns the underlying entity.
 org.joda.time.DateTime getRevisionDate()
          Returns the revision date of the revision.
 N getRevisionNumber()
          Returns the revision number of the revision.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Revision

public Revision(RevisionMetadata<? extends N> metadata,
                T entity)
Creates a new Revision consisting of the given RevisionMetadata and entity.

Parameters:
metadata - must not be null.
entity - must not be null.
Method Detail

getRevisionNumber

public N getRevisionNumber()
Returns the revision number of the revision.

Returns:
the revision number.

getRevisionDate

public org.joda.time.DateTime getRevisionDate()
Returns the revision date of the revision.

Returns:

getEntity

public T getEntity()
Returns the underlying entity.

Returns:
the entity

compareTo

public int compareTo(Revision<N,?> that)
Specified by:
compareTo in interface Comparable<Revision<N extends Number & Comparable<N>,?>>

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

Spring Data Commons

Copyright © 2012. All Rights Reserved.