Class FormatVersion

java.lang.Object
com.nomagic.persistence.FormatVersion
All Implemented Interfaces:
Serializable

@OpenApiAll public class FormatVersion extends Object implements Serializable
File format. Has application version and variants. Same application version may have different variants, converters must check file format not application version.
See Also:
  • Constructor Details

    • FormatVersion

      public FormatVersion(String applicationVersion, int variant)
      Create file format.
      Parameters:
      applicationVersion - application version.
      variant - variant of file format.
  • Method Details

    • isLaterThan

      public boolean isLaterThan(FormatVersion format)
      Checks if this file format is later than provided parameter.
      Parameters:
      format - another format to check.
      Returns:
      true if this file format is later than passed argument.
    • serialize

      public String serialize()
      Returns:
      serialized string of this file format.
    • deserialize

      public static FormatVersion deserialize(String serialized)
      Parameters:
      serialized - serialized string of file format.
      Returns:
      FileFormat read from string.
      Throws:
      IllegalArgumentException - if applicationVersion is not valid constant from com.nomagic.license.VersionNumberMap.
    • equals

      public boolean equals(@CheckForNull Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getVersion

      public String getVersion()
      Returns:
      application version of this file format.
    • getVariant

      public int getVariant()
      Returns:
      variant of this file format.