|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.unitils.dbmaintainer.version.Version
public class Version
Class representing the version of a database or the version of a script.
A version is represented by a modification timestamp and a list of version indexes. The indexes should be defined as follows: 01_folder/01_subfolder/1_script ==> 1,1,1
| Constructor Summary | |
|---|---|
Version(List<Long> indexes)
Creates a new version. |
|
Version(String indexString)
Creates a new version. |
|
| Method Summary | |
|---|---|
int |
compareTo(Version otherVersion)
Compares the given version to this version using the index values. |
boolean |
equals(Object obj)
|
protected List<Long> |
extractIndexes(String indexString)
Extracts the indexes out of the given string as followes: 1.x.2.x => 1, null, 2, null |
List<Long> |
getIndexes()
An empty list if no version is defined. |
String |
getIndexesString()
Gets a string representation of the indexes as followes: 1, null, 2, null => 1.x.2.x |
Long |
getScriptIndex()
Gets the last index in the list. |
int |
hashCode()
|
void |
setIndexes(List<Long> indexes)
Sets the indexes. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Version(List<Long> indexes)
indexes - The script indexes, not nulltimeStamp - The script timestamppublic Version(String indexString)
indexString - The indexes as a string| Method Detail |
|---|
public List<Long> getIndexes()
public Long getScriptIndex()
public void setIndexes(List<Long> indexes)
indexes - The script indexes, not nullpublic String getIndexesString()
protected List<Long> extractIndexes(String indexString)
indexString - The string
public String toString()
toString in class Objectpublic int compareTo(Version otherVersion)
compareTo in interface Comparable<Version>otherVersion - The other version, not null
public int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||