Class VersionBuilder
java.lang.Object
org.nuiton.version.VersionBuilder
To build some
Version.
General usage
Use one thecreate methods, custom what you need on build, and finally
use build() method to obtain a version.
Options details
TODOpreReleaseClassifierssplitSeparatorsjoinSeparatorsnapshot
Customize componants
TODOCreated on 7/11/14.
- Since:
- 1.0
- Author:
- Tony Chemit - chemit@codelutin.com
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected List<Comparable> List of componants of the version.List of componants separators explicitly definied (used asVersion.componantSeparators.protected CharacterThe character to join componant in a string representation.Classifiers known as pre-release classifiers.protected booleanIs the version a snapshot ?Set of characters used to split componants.protected StringThe string represention of the version. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddComponant(Comparable value) addComponant(Comparable value, char componantSeparator) build()static VersionBuildercreate()static VersionBuilderstatic VersionBuildercreate(List<Comparable> componants) static VersionBuilderprotected booleanprotected booleanprotected voidinitSeparatorList(List<String> list, int size) removeComponant(int level) setComponant(int level, Comparable value) setComponants(List<Comparable> componants) setComponantSeparator(int level, char value) setComponantSeparators(List<String> componantSeparators) setJoinSeparator(Character joinSeparator) setPreReleaseClassifiers(Set<String> preReleaseClassifiers) setSnapshot(boolean snapshot) setSplitSeparators(Set<Character> splitSeparators) setVersion(String version) protected static List<Comparable> toComparableList(List<Version.VersionComponant> componants) protected Version.VersionComponanttoVersionComponant(boolean numberState, String currentComponantStr)
-
Field Details
-
preReleaseClassifiers
-
splitSeparators
-
joinSeparator
The character to join componant in a string representation. -
version
The string represention of the version. -
componants
List of componants of the version. -
componantSeparators
List of componants separators explicitly definied (used asVersion.componantSeparators. -
snapshot
protected boolean snapshotIs the version a snapshot ? In a such case, theversionends with-SNAPSHOT.
-
-
Constructor Details
-
VersionBuilder
public VersionBuilder()
-
-
Method Details
-
create
-
create
-
create
-
create
-
setVersion
-
setComponants
-
setComponant
-
addComponant
-
addComponant
-
removeComponant
-
setComponantSeparators
-
setComponantSeparator
-
setSnapshot
-
setSplitSeparators
-
setJoinSeparator
-
setPreReleaseClassifiers
-
fromStringRepresentation
protected boolean fromStringRepresentation() -
fromComponants
protected boolean fromComponants() -
build
-
initSeparatorList
-
toVersionComponant
protected Version.VersionComponant toVersionComponant(boolean numberState, String currentComponantStr) -
toComparableList
-