Class SemanticVersion.Builder
java.lang.Object
xyz.apollosoftware.bibliothiki.versioning.schemes.semver.SemanticVersion.Builder
- Enclosing class:
SemanticVersion
A builder for a
SemanticVersion.-
Method Summary
Modifier and TypeMethodDescription@NonNull SemanticVersion.BuilderaddBuildMetadata(@NonNull String @NonNull ... buildMetadata) Add to the build metadata components.@NonNull SemanticVersion.BuilderaddBuildMetadata(@NonNull SemanticVersion.BuildIdentifier @NonNull ... buildMetadata) Add to the build metadata components.@NonNull SemanticVersion.BuilderaddPreRelease(@NonNull String @NonNull ... preRelease) Add to the pre-release components.@NonNull SemanticVersion.BuilderaddPreRelease(@NonNull SemanticVersion.PreReleaseIdentifier @NonNull ... preRelease) Add to the pre-release components.@NonNull SemanticVersionbuild()Build theSemanticVersionrepresentation from the properties set on the builder.@NonNull SemanticVersion.BuilderbuildMetadata(@NonNull SemanticVersion.BuildIdentifier @NonNull ... buildMetadata) Set the build metadata components.@NonNull SemanticVersion.Buildermajor(int major) Set the major version component.@NonNull SemanticVersion.Builderminor(int minor) Set the minor version component.@NonNull SemanticVersion.Builderpatch(int patch) Set the patch version component.@NonNull SemanticVersion.BuilderpreRelease(@NonNull SemanticVersion.PreReleaseIdentifier @NonNull ... preRelease) Set the pre-release components.@NonNull SemanticVersion.Builderversion(int major, int minor, int patch) Set the core version components (major, minor and patch) all at once.
-
Method Details
-
version
Set the core version components (major, minor and patch) all at once.- Parameters:
major- The major version component.minor- The minor version component.patch- The patch version component.- Returns:
- The builder instance.
-
major
Set the major version component.- Parameters:
major- The major version component.- Returns:
- The builder instance.
-
minor
Set the minor version component.- Parameters:
minor- The minor version component.- Returns:
- The builder instance.
-
patch
Set the patch version component.- Parameters:
patch- The patch version component.- Returns:
- The builder instance.
-
preRelease
public @NonNull SemanticVersion.Builder preRelease(@NonNull SemanticVersion.PreReleaseIdentifier @NonNull ... preRelease) Set the pre-release components.This method will overwrite any existing pre-release identifiers.
- Parameters:
preRelease- The pre-release version components.- Returns:
- The builder instance.
-
addPreRelease
Add to the pre-release components.This method parses the strings into
SemanticVersion.PreReleaseIdentifierobjects for convenience.- Parameters:
preRelease- The pre-release version components to add.- Returns:
- The builder instance.
- See Also:
-
addPreRelease
public @NonNull SemanticVersion.Builder addPreRelease(@NonNull SemanticVersion.PreReleaseIdentifier @NonNull ... preRelease) Add to the pre-release components.- Parameters:
preRelease- The pre-release version components to add.- Returns:
- The builder instance.
- See Also:
-
buildMetadata
public @NonNull SemanticVersion.Builder buildMetadata(@NonNull SemanticVersion.BuildIdentifier @NonNull ... buildMetadata) Set the build metadata components.This method will overwrite any existing build metadata components.
- Parameters:
buildMetadata- The build metadata components.- Returns:
- The builder instance.
-
addBuildMetadata
public @NonNull SemanticVersion.Builder addBuildMetadata(@NonNull String @NonNull ... buildMetadata) Add to the build metadata components.This method parses the strings into
SemanticVersion.BuildIdentifierobjects for convenience.- Parameters:
buildMetadata- The build metadata components to add.- Returns:
- The builder instance.
- See Also:
-
addBuildMetadata
public @NonNull SemanticVersion.Builder addBuildMetadata(@NonNull SemanticVersion.BuildIdentifier @NonNull ... buildMetadata) Add to the build metadata components.- Parameters:
buildMetadata- The build metadata components to add.- Returns:
- The builder instance.
- See Also:
-
build
Build theSemanticVersionrepresentation from the properties set on the builder.- Returns:
- The built
SemanticVersioninstance.
-