1 /**********************************************************************
2 * Copyright (c) 2013, 2014 Ericsson
4 * All rights reserved. This program and the accompanying materials are
5 * made available under the terms of the Eclipse Public License v1.0 which
6 * accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * Bernd Hufmann - Initial API and implementation
11 * Jonathan Rajotte - Machine interface support and new information
12 **********************************************************************/
14 package org
.eclipse
.linuxtools
.internal
.lttng2
.control
.ui
.views
.service
;
16 import org
.osgi
.framework
.Version
;
19 * A version implementation with a special compareTo implementation to bypass
20 * problems of older implementation of org.osgi.framework.Version.
22 * @author Bernd Hufmann
24 public class LttngVersion
extends Version
{
26 private final String fLicense
;
27 private final String fCommit
;
28 private final String fName
;
29 private final String fDescription
;
30 private final String fUrl
;
31 private final String fFullVersion
;
39 public LttngVersion(String version
) {
41 fLicense
= ""; //$NON-NLS-1$
42 fCommit
= ""; //$NON-NLS-1$
43 fName
= ""; //$NON-NLS-1$
44 fDescription
= ""; //$NON-NLS-1$
45 fUrl
= ""; //$NON-NLS-1$
46 fFullVersion
= ""; //$NON-NLS-1$
51 * major version number
53 * minor version number
55 * micro version number
57 * licence text of LTTng
59 * current git commit information about LTTng
63 * description of the version
67 * complete string representation of the version
69 public LttngVersion(int major
, int minor
, int micro
, String license
, String commit
, String name
, String description
, String url
, String fullVersion
) {
70 super(major
, minor
, micro
);
74 fDescription
= description
;
76 fFullVersion
= fullVersion
;
80 * Special compareTo method to fix problem of older implementations of
81 * org.osgi.framework.Version where {@code Version.compareTo} takes an
82 * {@code Object} instead a {@code Version} as argument.
85 * - Other version to compare
86 * @return a negative integer, zero, or a positive integer if this version
87 * is less than, equal to, or greater than the specified
88 * {@code LttngVersion} object.
90 public int compareTo(LttngVersion other
) {
91 if (other
== this) { // quicktest
94 int result
= getMajor() - other
.getMajor();
99 result
= getMinor() - other
.getMinor();
104 result
= getMicro() - other
.getMicro();
108 return getQualifier().compareTo(other
.getQualifier());
112 * @return String representing the lttng license
114 public String
getLicense() {
119 * @return commit id of lttng
121 public String
getCommit() {
126 * @return name of lttng version
128 public String
getName() {
133 * @return full description of lttng
135 public String
getDescription() {
140 * @return url of lttng
142 public String
getUrl() {
147 * @return the full_version
149 public String
getFullVersion() {
This page took 0.045349 seconds and 5 git commands to generate.