mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-11-18 03:47:18 +01:00
78 lines
2.3 KiB
Java
78 lines
2.3 KiB
Java
package org.codehaus.jackson;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes11.dex */
|
|
public class Version implements Comparable<Version> {
|
|
private static final Version UNKNOWN_VERSION = new Version(0, 0, 0, null);
|
|
protected final int _majorVersion;
|
|
protected final int _minorVersion;
|
|
protected final int _patchLevel;
|
|
protected final String _snapshotInfo;
|
|
|
|
public Version(int i, int i2, int i3, String str) {
|
|
this._majorVersion = i;
|
|
this._minorVersion = i2;
|
|
this._patchLevel = i3;
|
|
this._snapshotInfo = str;
|
|
}
|
|
|
|
public static Version unknownVersion() {
|
|
return UNKNOWN_VERSION;
|
|
}
|
|
|
|
@Override // java.lang.Comparable
|
|
public int compareTo(Version version) {
|
|
int i = this._majorVersion - version._majorVersion;
|
|
return (i == 0 && (i = this._minorVersion - version._minorVersion) == 0) ? this._patchLevel - version._patchLevel : i;
|
|
}
|
|
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
if (obj == null || obj.getClass() != getClass()) {
|
|
return false;
|
|
}
|
|
Version version = (Version) obj;
|
|
return version._majorVersion == this._majorVersion && version._minorVersion == this._minorVersion && version._patchLevel == this._patchLevel;
|
|
}
|
|
|
|
public int getMajorVersion() {
|
|
return this._majorVersion;
|
|
}
|
|
|
|
public int getMinorVersion() {
|
|
return this._minorVersion;
|
|
}
|
|
|
|
public int getPatchLevel() {
|
|
return this._patchLevel;
|
|
}
|
|
|
|
public int hashCode() {
|
|
return this._majorVersion + this._minorVersion + this._patchLevel;
|
|
}
|
|
|
|
public boolean isSnapshot() {
|
|
String str = this._snapshotInfo;
|
|
return str != null && str.length() > 0;
|
|
}
|
|
|
|
public boolean isUknownVersion() {
|
|
return this == UNKNOWN_VERSION;
|
|
}
|
|
|
|
public String toString() {
|
|
StringBuilder sb = new StringBuilder();
|
|
sb.append(this._majorVersion);
|
|
sb.append('.');
|
|
sb.append(this._minorVersion);
|
|
sb.append('.');
|
|
sb.append(this._patchLevel);
|
|
if (isSnapshot()) {
|
|
sb.append('-');
|
|
sb.append(this._snapshotInfo);
|
|
}
|
|
return sb.toString();
|
|
}
|
|
}
|