- Type Parameters:
V - a type that implements Version
- All Superinterfaces:
Comparable<V>
- All Known Implementing Classes:
MCDataVersion
public interface Version<V extends Version<V>>
extends Comparable<V>
An utility interface to represent a version and compare two versions.
-
Method Summary
default boolean
default boolean
Checks if this
Version is the same as or later than the given
Version.
default boolean
default boolean
Checks if this
Version is the same as or earlier than the given
Version.
default boolean
default boolean
-
Method Details
-
isBefore
default boolean isBefore(@NotNull
V other)
- Parameters:
other - the Version to compare
- Returns:
true if this Version is before the given Version, otherwise false
-
isAfter
default boolean isAfter(@NotNull
V other)
- Parameters:
other - the Version to compare
- Returns:
true if this Version is after the given Version, otherwise false
-
isSame
default boolean isSame(@NotNull
V other)
- Parameters:
other - the Version to compare
- Returns:
true if this Version is same as the given Version, otherwise false
-
isBeforeOrSame
default boolean isBeforeOrSame(@NotNull
V other)
Checks if this
Version is the same as or earlier than the given
Version.
- Parameters:
other - the Version to compare
- Returns:
true if this Version is the same as or earlier than the given Version, otherwise false
- See Also:
-
-
isAfterOrSame
default boolean isAfterOrSame(@NotNull
V other)
Checks if this
Version is the same as or later than the given
Version.
- Parameters:
other - the Version to compare
- Returns:
true if this Version is the same as or later than the given Version, otherwise false
- See Also:
-
-
isBetween
default boolean isBetween(@NotNull
V startInclusive,
@NotNull
V endInclusive)
- Parameters:
startInclusive - beginning of included Version
endInclusive - end of included Version
- Returns:
true if this Version is contained between the specified Versions, otherwise false