Class Version.Builder
java.lang.Object
com.github.zafarkhaja.semver.Version.Builder
- Enclosing class:
Version
A mutable builder for the immutable
Version class.- Since:
- 0.1.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds aVersionobject.private booleanChecks if a string has a usable value.setBuildMetadata(String build) Sets the build metadata.setNormalVersion(String normal) Sets the normal version.setPreReleaseVersion(String preRelease) Sets the pre-release version.
-
Field Details
-
normal
The normal version string. -
preRelease
The pre-release version string. -
build
The build metadata string.
-
-
Constructor Details
-
Builder
public Builder()Constructs aBuilderinstance. -
Builder
Constructs aBuilderinstance with the string representation of the normal version.- Parameters:
normal- the string representation of the normal version
-
-
Method Details
-
setNormalVersion
Sets the normal version.- Parameters:
normal- the string representation of the normal version- Returns:
- this builder instance
-
setPreReleaseVersion
Sets the pre-release version.- Parameters:
preRelease- the string representation of the pre-release version- Returns:
- this builder instance
-
setBuildMetadata
Sets the build metadata.- Parameters:
build- the string representation of the build metadata- Returns:
- this builder instance
-
build
Builds aVersionobject.- Returns:
- a newly built
Versioninstance - Throws:
ParseException- when invalid version string is providedUnexpectedCharacterException- is a special case ofParseException
-
isFilled
Checks if a string has a usable value.- Parameters:
str- the string to check- Returns:
trueif the string is filled orfalseotherwise
-