Package org.freeplane.core.util

# Class FreeplaneVersion

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

All Implemented Interfaces:
  `Comparable<FreeplaneVersion>`, `FreeplaneVersion`

public class FreeplaneVersion extends Object implements FreeplaneVersion
provides access to the current Freeplane version. In scripts use `c.freeplaneVersion`. For usage instructions see `compareTo(org.freeplane.api.FreeplaneVersion)`.

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`VERSION_KEY`
`static final String`
`VERSION_PROPERTIES`
`static final String`
`XML_VERSION`

## Constructor Summary

Constructors
Constructor
Description
`FreeplaneVersion(int pMaj, int pMid, int pMin)`
`FreeplaneVersion(int pMaj, int pMid, int pMin, String pType, int pNum)`

## Method Summary

Modifier and Type
Method
Description
`int`
`compareTo(FreeplaneVersion o)`
Use it like this:
`int`
`getMaj()`
`int`
`getMid()`
`int`
`getMin()`
`int`
`getNum()`
`String`
`getRevision()`
`String`
`getType()`
`static FreeplaneVersion`
`getVersion()`
`static FreeplaneVersion`
`getVersion(String pString)`
Parses a version string as FreeplaneVersion.
`boolean`
`isFinal()`
`boolean`
`isNewerThan(FreeplaneVersion freeplaneVersion)`
`boolean`
`isOlderThan(FreeplaneVersion freeplaneVersion)`
`String`
`numberToString()`
returns the version number only, e.g.
`String`
`toString()`
returns the full version number, e.g.

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

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

## Field Details

### VERSION_KEY

public static final String VERSION_KEY

See Also:
  - Constant Field Values

### VERSION_PROPERTIES

public static final String VERSION_PROPERTIES

See Also:
  - Constant Field Values

### XML_VERSION

public static final String XML_VERSION

See Also:
  - Constant Field Values

## Constructor Details

### FreeplaneVersion

public FreeplaneVersion(int pMaj, int pMid, int pMin, String pType, int pNum)

### FreeplaneVersion

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

## Method Details

### getVersion

public static FreeplaneVersion getVersion()

### getVersion

public static FreeplaneVersion getVersion(String pString) throws IllegalArgumentException
Parses a version string as FreeplaneVersion. Ignores leading 'v' (e.g. "v1.2.6") and accept '.' and ' ' as separator.

Throws:
  `IllegalArgumentException` - on parse errors

### getMaj

public int getMaj()

Specified by:
  `getMaj` in interface `FreeplaneVersion`

### getMid

public int getMid()

Specified by:
  `getMid` in interface `FreeplaneVersion`

### getMin

public int getMin()

Specified by:
  `getMin` in interface `FreeplaneVersion`

### getNum

public int getNum()

Specified by:
  `getNum` in interface `FreeplaneVersion`

### getType

public String getType()

Specified by:
  `getType` in interface `FreeplaneVersion`

### getRevision

public String getRevision()

Specified by:
  `getRevision` in interface `FreeplaneVersion`

### 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 `Comparable<FreeplaneVersion>`

### toString

public String toString()
returns the full version number, e.g. "1.0.38 rc".

Overrides:
  `toString` in class `Object`

### numberToString

public String numberToString()
returns the version number only, e.g. "1.0.38".

Specified by:
  `numberToString` in interface `FreeplaneVersion`

### isOlderThan

public boolean isOlderThan(FreeplaneVersion freeplaneVersion)

Specified by:
  `isOlderThan` in interface `FreeplaneVersion`

### isNewerThan

public boolean isNewerThan(FreeplaneVersion freeplaneVersion)

Specified by:
  `isNewerThan` in interface `FreeplaneVersion`

### isFinal

public boolean isFinal()

Specified by:
  `isFinal` in interface `FreeplaneVersion`