Class Revision
- java.lang.Object
-
- org.apache.subversion.javahl.types.Revision
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
Revision.DateSpec,Revision.Number
public class Revision extends java.lang.Object implements java.io.SerializableClass to specify a revision in a svn command.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classRevision.DateSpecclass to specify a revision by a datestatic classRevision.KindVarious ways of specifying revisions.static classRevision.Numberclass to specify a Revision by number
-
Field Summary
Fields Modifier and Type Field Description static RevisionBASEbase revision of working copystatic RevisionCOMMITTEDlast committed revision, needs working copystatic RevisionHEADlast committed revisionstatic RevisionPREVIOUSprevious committed revision, needs working copyprotected Revision.KindrevKindkind of revision specifiedprivate static longserialVersionUIDstatic RevisionSTARTfirst existing revisionstatic intSVN_INVALID_REVNUMMarker revision number for no real revisionstatic RevisionWORKINGworking version in working copy
-
Constructor Summary
Constructors Constructor Description Revision(Revision.Kind kind)Internally create a new revision.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) static Revision.NumbercreateNumber(long revNumber)Factory which creates#Numberobjects for valid revision numbers only (those greater than zero).booleanequals(java.lang.Object target)compare to revision objectsstatic RevisiongetInstance(long revisionNumber)Creates a Revision.Number objectstatic RevisiongetInstance(java.util.Date revisionDate)Creates a Revision.DateSpec objetRevision.KindgetKind()Returns the kind of the RevsioninthashCode()java.lang.StringtoString()return the textual representation of the revision
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
revKind
protected Revision.Kind revKind
kind of revision specified
-
HEAD
public static final Revision HEAD
last committed revision
-
START
public static final Revision START
first existing revision
-
COMMITTED
public static final Revision COMMITTED
last committed revision, needs working copy
-
PREVIOUS
public static final Revision PREVIOUS
previous committed revision, needs working copy
-
BASE
public static final Revision BASE
base revision of working copy
-
WORKING
public static final Revision WORKING
working version in working copy
-
SVN_INVALID_REVNUM
public static final int SVN_INVALID_REVNUM
Marker revision number for no real revision- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Revision
public Revision(Revision.Kind kind)
Internally create a new revision. Public for backward compat reasons. Callers should use getInstance() instead.- Parameters:
kind- kind of revision
-
-
Method Detail
-
getKind
public Revision.Kind getKind()
Returns the kind of the Revsion- Returns:
- kind
-
toString
public java.lang.String toString()
return the textual representation of the revision- Overrides:
toStringin classjava.lang.Object- Returns:
- english text
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object target)
compare to revision objects- Overrides:
equalsin classjava.lang.Object- Parameters:
target-- Returns:
- if both object have equal content
-
getInstance
public static Revision getInstance(long revisionNumber)
Creates a Revision.Number object- Parameters:
revisionNumber- the revision number of the new object- Returns:
- the new object
- Throws:
java.lang.IllegalArgumentException- If the specified revision number is invalid.
-
createNumber
static Revision.Number createNumber(long revNumber)
Factory which creates#Numberobjects for valid revision numbers only (those greater than zero). For internal usage to avoid an IllegalArgumentException, where no external consumer of the javahl API passed an invalid revision number.- Parameters:
revNumber- The revision number to create an object for.- Returns:
- An object representing
revNumber, ornullif the revision number was invalid.
-
getInstance
public static Revision getInstance(java.util.Date revisionDate)
Creates a Revision.DateSpec objet- Parameters:
revisionDate- the date of the new object- Returns:
- the new object
-
-