Package org.nuiton.version
Class VersionBuilder
- java.lang.Object
-
- org.nuiton.version.VersionBuilder
-
public class VersionBuilder extends Object
To build someVersion
.General usage
Use one thecreate
methods, custom what you need on build, and finally usebuild()
method to obtain a version.Options details
TODOpreReleaseClassifiers
splitSeparators
joinSeparator
snapshot
Customize componants
TODO Created on 7/11/14.- Since:
- 1.0
- Author:
- Tony Chemit - chemit@codelutin.com
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Comparable>
componants
List of componants of the version.protected List<String>
componantSeparators
List of componants separators explicitly definied (used asVersion.componantSeparators
.protected Character
joinSeparator
The character to join componant in a string representation.protected Set<String>
preReleaseClassifiers
Classifiers known as pre-release classifiers.protected boolean
snapshot
Is the version a snapshot ?protected Set<Character>
splitSeparators
Set of characters used to split componants.protected String
version
The string represention of the version.
-
Constructor Summary
Constructors Constructor Description VersionBuilder()
-
Method Summary
-
-
-
Field Detail
-
preReleaseClassifiers
protected Set<String> preReleaseClassifiers
Classifiers known as pre-release classifiers.
-
splitSeparators
protected Set<Character> splitSeparators
Set of characters used to split componants.
-
joinSeparator
protected Character joinSeparator
The character to join componant in a string representation.
-
version
protected String version
The string represention of the version.
-
componants
protected List<Comparable> componants
List of componants of the version.
-
componantSeparators
protected List<String> componantSeparators
List of componants separators explicitly definied (used asVersion.componantSeparators
.
-
snapshot
protected boolean snapshot
Is the version a snapshot ? In a such case, theversion
ends with-SNAPSHOT
.
-
-
Method Detail
-
create
public static VersionBuilder create()
-
create
public static VersionBuilder create(String version)
-
create
public static VersionBuilder create(Version version)
-
create
public static VersionBuilder create(List<Comparable> componants)
-
setVersion
public VersionBuilder setVersion(String version)
-
setComponants
public VersionBuilder setComponants(List<Comparable> componants)
-
setComponant
public VersionBuilder setComponant(int level, Comparable value)
-
addComponant
public VersionBuilder addComponant(Comparable value)
-
addComponant
public VersionBuilder addComponant(Comparable value, char componantSeparator)
-
removeComponant
public VersionBuilder removeComponant(int level)
-
setComponantSeparators
public VersionBuilder setComponantSeparators(List<String> componantSeparators)
-
setComponantSeparator
public VersionBuilder setComponantSeparator(int level, char value)
-
setSnapshot
public VersionBuilder setSnapshot(boolean snapshot)
-
setSplitSeparators
public VersionBuilder setSplitSeparators(Set<Character> splitSeparators)
-
setJoinSeparator
public VersionBuilder setJoinSeparator(Character joinSeparator)
-
setPreReleaseClassifiers
public VersionBuilder setPreReleaseClassifiers(Set<String> preReleaseClassifiers)
-
fromStringRepresentation
protected boolean fromStringRepresentation()
-
fromComponants
protected boolean fromComponants()
-
build
public Version build()
-
toVersionComponant
protected Version.VersionComponant toVersionComponant(boolean numberState, String currentComponantStr)
-
toComparableList
protected static List<Comparable> toComparableList(List<Version.VersionComponant> componants)
-
-