terp - the Codemesh Modular
Template Interpreter v1.3.337

com.codemesh.terp.data
Class VersionImpl

java.lang.Object
  extended by com.codemesh.terp.data.VersionImpl
All Implemented Interfaces:
Version, java.io.Serializable, java.lang.Comparable<Version>

public class VersionImpl
extends java.lang.Object
implements Version

The default implementation of the Version interface.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface com.codemesh.terp.data.Version
UNDEFINED
 
Method Summary
 int compareTo(Version o)
           
 boolean equals(java.lang.Object o)
           
 void fromComponentValues()
           
static Version fromMap(java.util.Map<java.lang.String,java.lang.Object> data)
           
static Version fromString(java.lang.String str)
           
 void fromVersionString()
           
 int getBuild()
          Returns the build version number.
 Version getLessSpecific()
          A factory method that returns a less specific version than the version it is invoked upon.
 int getMajor()
          Returns the major version number.
 int getMinor()
          Returns the minor version number.
 int getPatch()
          Returns the patch version number.
 java.lang.String getPrefix()
          Returns the version number's prefix string.
 java.lang.String getSuffix()
          Returns the version suffix.
 int hashCode()
           
 void setBuild(int build)
           
 void setMajor(int major)
           
 void setMinor(int minor)
           
 void setPatch(int patch)
           
 void setPrefix(java.lang.String prefix)
           
 void setSuffix(java.lang.String suffix)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

fromString

public static Version fromString(java.lang.String str)

fromMap

public static Version fromMap(java.util.Map<java.lang.String,java.lang.Object> data)

getPrefix

public java.lang.String getPrefix()
Description copied from interface: Version
Returns the version number's prefix string. Some version numbers contain a non-numeric prefix, for example HP-UX versions like 'B.11.11'. In this case, the prefix would be 'B.'.

Specified by:
getPrefix in interface Version
Returns:
the version's prefix, normally the empty string.

setPrefix

public void setPrefix(java.lang.String prefix)

getMajor

public int getMajor()
Description copied from interface: Version
Returns the major version number.

Specified by:
getMajor in interface Version
Returns:
the major version.

setMajor

public void setMajor(int major)

getMinor

public int getMinor()
Description copied from interface: Version
Returns the minor version number.

Specified by:
getMinor in interface Version
Returns:
the minor version.

setMinor

public void setMinor(int minor)

getPatch

public int getPatch()
Description copied from interface: Version
Returns the patch version number.

Specified by:
getPatch in interface Version
Returns:
the patch version.

setPatch

public void setPatch(int patch)

getBuild

public int getBuild()
Description copied from interface: Version
Returns the build version number.

Specified by:
getBuild in interface Version
Returns:
the build version.

setBuild

public void setBuild(int build)

getSuffix

public java.lang.String getSuffix()
Description copied from interface: Version
Returns the version suffix.

Specified by:
getSuffix in interface Version
Returns:
the version suffix.

getLessSpecific

public Version getLessSpecific()
Description copied from interface: Version
A factory method that returns a less specific version than the version it is invoked upon. For example, if the receiving version is '1.1.5', the less specific version will be '1.1'. When there is no less specific version, null is returned.

Specified by:
getLessSpecific in interface Version
Returns:
a less specific version than this version or null if there is no less specific version.

setSuffix

public void setSuffix(java.lang.String suffix)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

compareTo

public int compareTo(Version o)
Specified by:
compareTo in interface java.lang.Comparable<Version>

fromComponentValues

public void fromComponentValues()

fromVersionString

public void fromVersionString()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

terp - the Codemesh Modular
Template Interpreter v1.3.337

Copyright © 2008-2016 by Codemesh, Inc. All Rights Reserved.