org.freeplane.core.util

## Class FreeplaneVersion

- java.lang.Object
- - org.freeplane.core.util.FreeplaneVersion

- All Implemented Interfaces:
    java.lang.Comparable<FreeplaneVersion>

      public class FreeplaneVersion
      extends java.lang.Object
      implements java.lang.Comparable<FreeplaneVersion>

  provides access to the current Freeplane version. In scripts use `c.freeplaneVersion`. For usage instructions see `compareTo(FreeplaneVersion)`.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `VERSION_KEY`
    `static java.lang.String` | `VERSION_PROPERTIES`
    `static java.lang.String` | `XML_VERSION`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FreeplaneVersion(int pMaj, int pMid, int pMin)`
    `FreeplaneVersion(int pMaj, int pMid, int pMin, java.lang.String pType, int pNum, java.lang.String revision)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(FreeplaneVersion o)` Use it like this: import org.freeplane.core.util.FreeplaneVersion def required = FreeplaneVersion.getVersion("1.2.20") if (c.freeplaneVersion < required) ui.errorMessage("Freeplane version ${c.freeplaneVersion}" + " not supported - update to at least ${required}")
    `int` | `getMaj()`
    `int` | `getMid()`
    `int` | `getMin()`
    `int` | `getNum()`
    `java.lang.String` | `getRevision()`
    `java.lang.String` | `getType()`
    `static FreeplaneVersion` | `getVersion()`
    `static FreeplaneVersion` | `getVersion(java.lang.String pString)` Parses a version string as FreeplaneVersion.
    `boolean` | `isFinal()`
    `boolean` | `isNewerThan(FreeplaneVersion freeplaneVersion)`
    `boolean` | `isOlderThan(FreeplaneVersion freeplaneVersion)`
    `java.lang.String` | `numberToString()` returns the version number only, e.g. "1.0.38".
    `java.lang.String` | `toString()` returns the full version number, e.g. "1.0.38 rc".

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### VERSION_KEY

          public static final java.lang.String VERSION_KEY

      See Also:
        Constant Field Values

    - #### VERSION_PROPERTIES

          public static final java.lang.String VERSION_PROPERTIES

      See Also:
        Constant Field Values

    - #### XML_VERSION

          public static final java.lang.String XML_VERSION

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FreeplaneVersion

          public FreeplaneVersion(int pMaj,
                                  int pMid,
                                  int pMin,
                                  java.lang.String pType,
                                  int pNum,
                                  java.lang.String revision)

    - #### FreeplaneVersion

          public FreeplaneVersion(int pMaj,
                                  int pMid,
                                  int pMin)

  - ### Method Detail

    - #### getVersion

          public static FreeplaneVersion getVersion()

    - #### getVersion

          public static FreeplaneVersion getVersion(java.lang.String pString)
                                             throws java.lang.IllegalArgumentException

      Parses a version string as FreeplaneVersion. Ignores leading 'v' (e.g. "v1.2.6") and accept '.' and ' ' as separator.
      Throws:
        `java.lang.IllegalArgumentException` - on parse errors

    - #### getMaj

          public int getMaj()

    - #### getMid

          public int getMid()

    - #### getMin

          public int getMin()

    - #### getNum

          public int getNum()

    - #### getType

          public java.lang.String getType()

    - #### getRevision

          public java.lang.String getRevision()

    - #### compareTo

          public int compareTo(FreeplaneVersion o)

      Use it like this:

             import org.freeplane.core.util.FreeplaneVersion
             def required = FreeplaneVersion.getVersion("1.2.20")
             if (c.freeplaneVersion < required)
                 ui.errorMessage("Freeplane version ${c.freeplaneVersion}"
                     + " not supported - update to at least ${required}")

      Specified by:
        `compareTo` in interface `java.lang.Comparable<FreeplaneVersion>`

    - #### toString

          public java.lang.String toString()

      returns the full version number, e.g. "1.0.38 rc".
      Overrides:
        `toString` in class `java.lang.Object`

    - #### numberToString

          public java.lang.String numberToString()

      returns the version number only, e.g. "1.0.38".

    - #### isOlderThan

          public boolean isOlderThan(FreeplaneVersion freeplaneVersion)

    - #### isNewerThan

          public boolean isNewerThan(FreeplaneVersion freeplaneVersion)

    - #### isFinal

          public boolean isFinal()