
org.dmfs.semver.WithBuildMeta Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of semver Show documentation
Show all versions of semver Show documentation
Yet another Java Semver implementation.
The newest version!
package org.dmfs.semver;
import org.dmfs.jems2.Optional;
import org.dmfs.jems2.optional.Present;
/**
* A {@link Version} decorator to add or replace a build meta tag of a given {@link Version}.
*/
public final class WithBuildMeta implements Version
{
private final Version mDelegate;
private final Optional mBuildMeta;
public WithBuildMeta(Version delegate, String buildMeta)
{
mDelegate = delegate;
mBuildMeta = new Present<>(buildMeta);
}
@Override
public int major()
{
return mDelegate.major();
}
@Override
public int minor()
{
return mDelegate.minor();
}
@Override
public int patch()
{
return mDelegate.patch();
}
@Override
public Optional preRelease()
{
return mDelegate.preRelease();
}
@Override
public Optional build()
{
return mBuildMeta;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy