Included generated source file.

This commit is contained in:
Erik C. Thauvin 2017-04-22 09:10:21 -07:00
parent 4a8b379634
commit 746102ec54

View file

@ -0,0 +1,104 @@
/*
* This file is automatically generated.
* Do not modify! -- ALL CHANGES WILL BE ERASED!
*/
package net.thauvin.erik.semver.example;
import java.util.Date;
/**
* Provides semantic version information.
*
* @author <a href="https://github.com/ethauvin/semver">Semantic Version
* Annotation Processor</a>
*/
public final class GeneratedVersion {
private final static String DEFAULT_PRERELEASE_PREFIX = "-";
private final static String DEFAULT_BUILDMETA_PREFIX = "+";
final static String project = "Example";
final static Date buildDate = new Date(1492727792896L);
final static int major = 2;
final static int minor = 17;
final static int patch = 52;
final static String preRelease = "beta";
final static String buildMeta = "007";
/**
* The full version string.
* <p>
* Formatted as:
* <blockquote>
* <code>MAJOR.MINOR.PATCH[-PRERELEASE][+BUILDMETADATA]</code>
* </blockquote>
* <p>
* For example:
* <ul>
* <li><code>1.0.0</code></li>
* <li><code>1.0.0-beta</code></li>
* <li><code>1.0.0+20160124144700</code></li>
* <li><code>1.0.0-alpha+001</code></li>
* </ul>
*/
final static String version = Integer.toString(major) + '.'
+ Integer.toString(minor) + '.'
+ Integer.toString(patch)
+ preReleaseWithPrefix() + buildMetaWithPrefix();
/**
* Disables the default constructor.
*
* @throws UnsupportedOperationException If the constructor is called.
*/
private GeneratedVersion()
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Illegal constructor call.");
}
/**
* Returns the build metadata with default prefix.
*
* @param prefix The prefix to prepend.
* @return The build metadata, if any.
*/
public static String buildMetaWithPrefix() {
return buildMetaWithPrefix(DEFAULT_PRERELEASE_PREFIX);
}
/**
* Returns the build metadata.
*
* @param prefix Prefix to prepend.
* @return The build metadata, if any.
*/
public static String buildMetaWithPrefix(final String prefix) {
if (buildMeta.length() > 0 && prefix.length() > 0) {
return prefix + buildMeta;
} else {
return buildMeta;
}
}
/**
* Returns the pre-release version with default prefix.
*
* @return The pre-release version, if any.
*/
public static String preReleaseWithPrefix() {
return preReleaseWithPrefix(DEFAULT_PRERELEASE_PREFIX);
}
/**
* Returns the pre-release version.
*
* @param prefix The prefix to prepend.
* @return The pre-release version, if any.
*/
public static String preReleaseWithPrefix(final String prefix) {
if (preRelease.length() > 0 && prefix.length() > 0) {
return prefix + preRelease;
} else {
return preRelease;
}
}
}