Package springfox.documentation.common
Class Version
- java.lang.Object
-
- springfox.documentation.common.Version
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(Version that)
boolean
equals(java.lang.Object obj)
int
hashCode()
boolean
is(Version version)
Returns whether the currentVersion
is the same as the given one.boolean
isGreaterThan(Version version)
Returns whether the currentVersion
is greater (newer) than the given one.boolean
isGreaterThanOrEqualTo(Version version)
Returns whether the currentVersion
is greater (newer) or the same as the given one.boolean
isLessThan(Version version)
Returns whether the currentVersion
is less (older) than the given one.boolean
isLessThanOrEqualTo(Version version)
Returns whether the currentVersion
is less (older) or equal to the current one.static Version
parse(java.lang.String version)
Parses the given string representation of a version into aVersion
object.java.lang.String
toString()
-
-
-
Constructor Detail
-
Version
public Version(int... parts)
Creates a newVersion
from the given integer values. At least one value has to be given but a maximum of 4.- Parameters:
parts
- must not be null or empty.
-
-
Method Detail
-
parse
public static Version parse(java.lang.String version)
Parses the given string representation of a version into aVersion
object.- Parameters:
version
- must not be null or empty.- Returns:
- returns version
-
isGreaterThan
public boolean isGreaterThan(Version version)
Returns whether the currentVersion
is greater (newer) than the given one.- Parameters:
version
- - candidate version- Returns:
- true or false based on version comparison
-
isGreaterThanOrEqualTo
public boolean isGreaterThanOrEqualTo(Version version)
Returns whether the currentVersion
is greater (newer) or the same as the given one.- Parameters:
version
- - candidate version- Returns:
- true or false based on version comparison
-
is
public boolean is(Version version)
Returns whether the currentVersion
is the same as the given one.- Parameters:
version
- - candidate version- Returns:
- true or false based on version comparison
-
isLessThan
public boolean isLessThan(Version version)
Returns whether the currentVersion
is less (older) than the given one.- Parameters:
version
- - candidate version- Returns:
- true or false based on version comparison
-
isLessThanOrEqualTo
public boolean isLessThanOrEqualTo(Version version)
Returns whether the currentVersion
is less (older) or equal to the current one.- Parameters:
version
- - candidate version- Returns:
- true or false based on version comparison
-
compareTo
public int compareTo(Version that)
- Specified by:
compareTo
in interfacejava.lang.Comparable<Version>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-