1 8 9 package com.sleepycat.je; 10 11 15 public class JEVersion { 16 17 21 public static final JEVersion CURRENT_VERSION = 22 new JEVersion(3, 2, 13, null); 23 24 private int majorNum; 25 private int minorNum; 26 private int patchNum; 27 private String name; 28 29 private JEVersion(int majorNum, int minorNum, int patchNum, String name) { 30 this.majorNum = majorNum; 31 this.minorNum = minorNum; 32 this.patchNum = patchNum; 33 this.name = name; 34 } 35 36 40 public String toString() { 41 return getVersionString(); 42 } 43 44 48 public int getMajor() { 49 return majorNum; 50 } 51 52 56 public int getMinor() { 57 return minorNum; 58 } 59 60 64 public int getPatch() { 65 return patchNum; 66 } 67 68 72 public String getNumericVersionString() { 73 StringBuffer version = new StringBuffer (); 74 version.append(majorNum).append("."); 75 version.append(minorNum).append("."); 76 version.append(patchNum); 77 return version.toString(); 78 } 79 80 84 public String getVersionString() { 85 StringBuffer version = new StringBuffer (); 86 version.append(majorNum).append("."); 87 version.append(minorNum).append("."); 88 version.append(patchNum); 89 if (name != null) { 90 version.append(" ("); 91 version.append(name).append(")"); 92 } 93 return version.toString(); 94 } 95 } 96 | Popular Tags |