01: /*
02: * Copyright (C) 2004 NNL Technology AB
03: * Visit www.infonode.net for information about InfoNode(R)
04: * products and how to contact NNL Technology AB.
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston,
19: * MA 02111-1307, USA.
20: */
21:
22: //$Id: ProductVersion.java,v 1.3 2004/09/28 14:57:39 jesper Exp $
23: package net.infonode.util;
24:
25: import java.io.Serializable;
26:
27: /**
28: * A class that represents a product version
29: *
30: * @author $Author: jesper $
31: * @version $Revision: 1.3 $
32: */
33: public class ProductVersion implements Serializable {
34: private static final long serialVersionUID = 1;
35:
36: private int major;
37: private int minor;
38: private int patch;
39:
40: /**
41: * Constructs a product version object
42: *
43: * @param major Major version number
44: * @param minor Minor version number
45: * @param patch Patch version number
46: */
47: public ProductVersion(int major, int minor, int patch) {
48: this .major = major;
49: this .minor = minor;
50: this .patch = patch;
51: }
52:
53: /**
54: * Gets the major version number, i.e.
55: * the number X in version X.0.0
56: *
57: * @return Major version number
58: */
59: public int getMajor() {
60: return major;
61: }
62:
63: /**
64: * Gets the minor version number, i.e.
65: * the number X in version 0.X.0
66: *
67: * @return Minor version number
68: */
69: public int getMinor() {
70: return minor;
71: }
72:
73: /**
74: * Gets the patch version number, i.e.
75: * the number X in version 0.0.X
76: *
77: * @return Minor version number
78: */
79: public int getPatch() {
80: return patch;
81: }
82:
83: /**
84: * Gets the version as string
85: *
86: * @return Version as string
87: */
88: public String toString() {
89: return major + "." + minor + "." + patch;
90: }
91: }
|