Interface FormatVersion
-
- All Superinterfaces:
java.lang.Comparable<FormatVersion>
@Immutable(builder=false) public interface FormatVersion extends java.lang.Comparable<FormatVersion>
A version of the Minecraft bundler metadata format.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringMANIFEST_ATTRIBUTEAn attribute in the manifest of bundler jars containing a format version.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intcompareTo(FormatVersion other)default booleancompatibleWith(FormatVersion other)Whether a version ofothercan interpret data in this format version.intmajor()Major version.intminor()Minor version.static FormatVersionof(int major, int minor)Create a format version directly.static FormatVersionparse(java.lang.String attribute)Parse the manifest attribute version.
-
-
-
Field Detail
-
MANIFEST_ATTRIBUTE
static final java.lang.String MANIFEST_ATTRIBUTE
An attribute in the manifest of bundler jars containing a format version.- See Also:
parse(String), Constant Field Values
-
-
Method Detail
-
parse
static FormatVersion parse(java.lang.String attribute)
Parse the manifest attribute version.- Parameters:
attribute- the attribute value- Returns:
- a parsed version
- Throws:
java.lang.NumberFormatException- if any elements of the attribute are non-numericjava.lang.IllegalArgumentException- if the version does not have at least two elements
-
of
static FormatVersion of(int major, int minor)
Create a format version directly.- Parameters:
major- the major versionminor- the minor version- Returns:
- a new format version object
-
major
@Parameter int major()
Major version. Indicates incompatible changes.- Returns:
- the major version
-
minor
@Parameter int minor()
Minor version. Indicates additions and other compatible changes.- Returns:
- the minor version
-
compatibleWith
default boolean compatibleWith(FormatVersion other)
Whether a version ofothercan interpret data in this format version.- Parameters:
other- the compared version- Returns:
- whether other is compatible with this version's data
-
compareTo
default int compareTo(FormatVersion other)
- Specified by:
compareToin interfacejava.lang.Comparable<FormatVersion>
-
-