01: package org.tigris.subversion.javahl;
02:
03: /**
04: * @copyright
05: * ====================================================================
06: * Copyright (c) 2005 CollabNet. All rights reserved.
07: *
08: * This software is licensed as described in the file COPYING, which
09: * you should have received as part of this distribution. The terms
10: * are also available at http://subversion.tigris.org/license-1.html.
11: * If newer versions of this license are posted there, you may use a
12: * newer version instead, at your option.
13: *
14: * This software consists of voluntary contributions made by many
15: * individuals. For exact contribution history, see the revision
16: * history and logs, available at http://subversion.tigris.org/.
17: * ====================================================================
18: * @endcopyright
19: */
20:
21: /**
22: * Encapsulates version information about the underlying native
23: * libraries. Basically a wrapper for <a
24: * href="http://svn.collab.net/repos/svn/trunk/subversion/include/svn_version.h"><code>svn_version.h</code></a>.
25: */
26: public class Version {
27: /**
28: * @return The full version string for the loaded JavaHL library,
29: * as defined by <code>MAJOR.MINOR.PATCH INFO</code>.
30: * @since 1.4.0
31: */
32: public String toString() {
33: StringBuffer version = new StringBuffer();
34: version.append(getMajor()).append('.').append(getMinor())
35: .append('.').append(getPatch()).append(getNumberTag())
36: .append(getTag());
37: return version.toString();
38: }
39:
40: /**
41: * @return The major version number for the loaded JavaHL library.
42: * @since 1.4.0
43: */
44: public native int getMajor();
45:
46: /**
47: * @return The minor version number for the loaded JavaHL library.
48: * @since 1.4.0
49: */
50: public native int getMinor();
51:
52: /**
53: * @return The patch-level version number for the loaded JavaHL
54: * library.
55: * @since 1.4.0
56: */
57: public native int getPatch();
58:
59: /**
60: * @return Some text further describing the library version
61: * (e.g. <code>" (r1234)"</code>, <code>" (Alpha 1)"</code>,
62: * <code>" (dev build)"</code>, etc.).
63: * @since 1.4.0
64: */
65: private native String getTag();
66:
67: /**
68: * @return Some text further describing the library version
69: * (e.g. "r1234", "Alpha 1", "dev build", etc.).
70: * @since 1.4.0
71: */
72: private native String getNumberTag();
73: }
|