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 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-numeric
        java.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 version
        minor - 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 of other can 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:
        compareTo in interface java.lang.Comparable<FormatVersion>