01: /*
02: * All content copyright (c) 2003-2007 Terracotta, Inc., except as may otherwise be noted in a separate copyright
03: * notice. All rights reserved.
04: */
05: package com.tc.bundles;
06:
07: final class Version extends org.osgi.framework.Version {
08:
09: public Version(String arg0) {
10: super (arg0.replace('-', '.'));
11: }
12:
13: public Version(int major, int minor, int micro) {
14: super (major, minor, micro);
15: }
16:
17: public Version(int major, int minor, int micro, String qualifier) {
18: super (major, minor, micro, qualifier);
19: }
20:
21: public static Version parse(String version) {
22: org.osgi.framework.Version v = org.osgi.framework.Version
23: .parseVersion(version.replace('-', '.'));
24: return new Version(v.getMajor(), v.getMinor(), v.getMicro(), v
25: .getQualifier());
26: }
27:
28: public String toString() {
29: return getMajor() + ";" + getMinor() + ";" + getMicro() + ";"
30: + getQualifier();
31: }
32: }
|