Package com.github.zafarkhaja.semver
Class Version.Builder
- java.lang.Object
-
- com.github.zafarkhaja.semver.Version.Builder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Versionbuild()Builds aVersionobject.Version.BuildersetBuildMetadata(String build)Sets the build metadata.Version.BuildersetNormalVersion(String normal)Sets the normal version.Version.BuildersetPreReleaseVersion(String preRelease)Sets the pre-release version.
-
-
-
Constructor Detail
-
Builder
public Builder()
Constructs aBuilderinstance.
-
Builder
public Builder(String normal)
Constructs aBuilderinstance with the string representation of the normal version.- Parameters:
normal- the string representation of the normal version
-
-
Method Detail
-
setNormalVersion
public Version.Builder setNormalVersion(String normal)
Sets the normal version.- Parameters:
normal- the string representation of the normal version- Returns:
- this builder instance
-
setPreReleaseVersion
public Version.Builder setPreReleaseVersion(String preRelease)
Sets the pre-release version.- Parameters:
preRelease- the string representation of the pre-release version- Returns:
- this builder instance
-
setBuildMetadata
public Version.Builder setBuildMetadata(String build)
Sets the build metadata.- Parameters:
build- the string representation of the build metadata- Returns:
- this builder instance
-
build
public Version build()
Builds aVersionobject.- Returns:
- a newly built
Versioninstance - Throws:
ParseException- when invalid version string is providedUnexpectedCharacterException- is a special case ofParseException
-
-