net.sourceforge.argval.version
Class VersionNumberImpl

java.lang.Object
  extended by net.sourceforge.argval.version.VersionNumberImpl
All Implemented Interfaces:
VersionNumber, VersionNumberVisitorAcceptor

public class VersionNumberImpl
extends Object
implements VersionNumber

An implementation of VersionNumber.

Author:
T. Verhagen

Constructor Summary
VersionNumberImpl(List<String> versionList)
          Constructs a VersionNumber.
 
Method Summary
 void accept(VersionNumberVisitor visitor)
          The entry point for the visitor.
 boolean equals(Object obj)
           
 String getAsText(String separator)
          Returns the version number as text, using the separator, for separation of the different version number parts.
 List<String> getPartitionedVersion()
          A list of strings, which form together the version number.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VersionNumberImpl

public VersionNumberImpl(List<String> versionList)
Constructs a VersionNumber. The given List should not be null and at least contain one element. No empty or null elements are expected.

Parameters:
versionList - - the List of String instances that build up the version number.
Throws:
IllegalArgumentException - If argument is null, contains nulls, or is empty.
Method Detail

getPartitionedVersion

public List<String> getPartitionedVersion()
Description copied from interface: VersionNumber
A list of strings, which form together the version number.

Specified by:
getPartitionedVersion in interface VersionNumber
Returns:
The list of strings.

accept

public void accept(VersionNumberVisitor visitor)
Description copied from interface: VersionNumberVisitorAcceptor
The entry point for the visitor.

Specified by:
accept in interface VersionNumberVisitorAcceptor
Parameters:
visitor - - the version number visitor

getAsText

public String getAsText(String separator)
Description copied from interface: VersionNumber
Returns the version number as text, using the separator, for separation of the different version number parts. Example:
 Given the version number parts: [2, 2, 3, beta, 3]
 Will result in the text: '2.2.3.beta.3'
 

Specified by:
getAsText in interface VersionNumber
Parameters:
separator - - the separator, used between the different version number parts.
Returns:
The version number as text.

toString

public String toString()
Overrides:
toString in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object


Copyright © 2013 Verhagen Software. All Rights Reserved.