org.tmatesoft.svn.core.wc
public class SVNRevision extends Object
Most of high-level API classes' methods receive revision parameters as SVNRevision objects to get information on SVN revisions and use it in version control operations.
This class provides advantages of specifying revisions either as just long numbers or dated revisions (when a revision is determined according to a particular timestamp) or SVN compatible keywords denoting the latest revision (HEAD), Working Copy pristine revision (BASE) and so on. And one more feature is that SVNRevision can parse strings (that can be anything: string representations of numbers, dates, keywords) to construct an SVNRevision to use.
Version: 1.1.1
Field Summary | |
---|---|
static SVNRevision | BASE
Denotes the 'pristine' revision of a Working Copy item.
|
static SVNRevision | COMMITTED
Denotes the last revision in which an item was changed before (or
at) BASE. |
static SVNRevision | HEAD
Denotes the latest repository revision. |
static SVNRevision | PREVIOUS
Denotes the revision just before the one when an item was last
changed (technically, COMMITTED - 1). |
static SVNRevision | UNDEFINED
Used to denote that a revision is undefined (not available or not
valid). |
static SVNRevision | WORKING
Denotes an item's working (current) revision. |
Method Summary | |
---|---|
static SVNRevision | create(long revisionNumber)
Creates an SVNRevision object given a revision number.
|
static SVNRevision | create(Date date)
Creates an SVNRevision object given a particular timestamp.
|
boolean | equals(Object o)
Compares this object with another SVNRevision object.
|
Date | getDate()
Gets the timestamp used to specify a revision.
|
int | getID()
Gets the identifier of the revision information kind this
object represents.
|
String | getName()
Gets the revision keyword name. |
long | getNumber()
Gets the revision number represented by this object.
|
int | hashCode()
Evaluates the hash code for this object.
|
boolean | isLocal() |
boolean | isValid()
Checks if the revision information represented by this object
is valid.
|
static boolean | isValidRevisionNumber(long revision)
Checks whether a revision number is valid.
|
static SVNRevision | parse(String value)
Parses an input string and be it a representation of either
a revision number, or a timestamp, or a revision keyword, constructs
an SVNRevision representation of the revision.
|
String | toString()
Gives a string representation of this object.
|
Parameters: revisionNumber a definite revision number
Returns: the constructed SVNRevision object
Parameters: date a timestamp represented as a Date instance
Returns: the constructed SVNRevision object
Parameters: o an object to be compared with; if it's not an SVNRevision then this method certainly returns false
Returns: true if equal, otherwise false
Returns: a timestamp if any specified for this object
Returns: this object's id
Returns: a revision keyword name
Returns: a revision number; -1 is returned when this object represents a revision information not using a revision number.
hash code = (int) revisionNumber & 0xFFFFFFFF
;
Returns: this object's hash code
Returns: true if this object represents a kind of a local revision, otherwise false
UNDEFINED is not a valid revision.
Returns: true if valid, otherwise false
Parameters: revision a revision number
Returns: true if valid, otherwise false
Parameters: value a string to be parsed
Returns: an SVNRevision object that holds the revision
information parsed from value
; however
if an input string is not a valid one which can be
successfully transformed to an SVNRevision the
return value is UNDEFINED
Returns: a string representing this object