01: /*
02: * Copyright 2006-2007, Unitils.org
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16: package org.unitils.dbmaintainer.version;
17:
18: /**
19: * Class representing the version of a database, or the version of a number of DDL scripts.
20: *
21: * @author Filip Neven
22: * @author Tim Ducheyne
23: */
24: public class Version {
25:
26: /* The index of the last (executed) script */
27: private Long index;
28:
29: /* The timestamp of the script that was last modified, expressed as the number of milliseconds since January 1, 1970 */
30: private Long timeStamp;
31:
32: /**
33: * Creates a new version.
34: *
35: * @param index The script index, not null
36: * @param timeStamp The script timestamp, not null
37: */
38: public Version(Long index, Long timeStamp) {
39: this .index = index;
40: this .timeStamp = timeStamp;
41: }
42:
43: /**
44: * @return The script index, not null
45: */
46: public Long getIndex() {
47: return index;
48: }
49:
50: /**
51: * @return The script timestamp, not null
52: */
53: public Long getTimeStamp() {
54: return timeStamp;
55: }
56:
57: /**
58: * @return The string representation of the version.
59: */
60: @Override
61: public String toString() {
62: return "Index " + index + "; timestamp = " + timeStamp;
63: }
64:
65: }
|