Upaded default template.

This commit is contained in:
Erik C. Thauvin 2016-01-27 19:01:23 -08:00
parent 0d37a19c63
commit 703362c2b3
6 changed files with 103 additions and 103 deletions

View file

@ -20,109 +20,109 @@ public final class ${className} {
private final static String prerelease = "${prerelease}";
private final static String project = "${project}";
/**
* Returns the build date.
*
* @return The build date.
*/
public static Date getBuildDate() {
return date;
}
/**
* Disables the default constructor.
*
* @throws UnsupportedOperationException if the constructor is called.
*/
private GeneratedVersion()
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Illegal constructor call.");
}
/**
* Returns 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>
*
* @return The version string.
*/
public static String getVersion() {
return Integer.toString(getMajor()) + '.'
+ Integer.toString(getMinor()) + '.'
+ Integer.toString(getPatch())
+ getPreRelease() + getBuildMetadata();
}
/**
* Returns the build date.
*
* @return The build date.
*/
public static Date getBuildDate() {
return date;
}
/**
* Returns the major version.
*
* @return The major version.
*/
public static int getMajor() {
return major;
}
/**
* Returns the project name.
*
* @return The project name, if any.
*/
public static String getProject() {
return project;
}
/**
* Returns the minor version.
*
* @return The minor version.
*/
public static int getMinor() {
return minor;
}
/**
* Returns 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>
*
* @return The version string.
*/
public static String getVersion() {
return Integer.toString(getMajor()) + '.'
+ Integer.toString(getMinor()) + '.'
+ Integer.toString(getPatch())
+ getPreRelease() + getBuildMetadata();
}
/**
* Returns the patch version.
*
* @return The patch version.
*/
public static int getPatch() {
return patch;
}
/**
* Returns the major version.
*
* @return The major version.
*/
public static int getMajor() {
return major;
}
/**
* Returns the pre-release version.
*
* @return The pre-release version, if any.
*/
public static String getPreRelease() {
if (prerelease.length() > 0) {
return '-' + prerelease;
}
/**
* Returns the minor version.
*
* @return The minor version.
*/
public static int getMinor() {
return minor;
}
return "";
}
/**
* Returns the patch version.
*
* @return The patch version.
*/
public static int getPatch() {
return patch;
}
/**
* Returns the project name.
*
* @return The project name, if any.
*/
public static String getProject() {
return project;
}
/**
* Returns the pre-release version.
*
* @return The pre-release version, if any.
*/
public static String getPreRelease() {
if (prerelease.length() > 0) {
return '-' + prerelease;
}
/**
* Returns the build metadata.
*
* @return The build metadata, if any.
*/
public static String getBuildMetadata() {
if (buildmeta.length() > 0) {
return '+' + buildmeta;
}
return "";
}
return "";
}
/**
* Disables the default constructor.
*
* @throws UnsupportedOperationException if the constructor is called.
*/
private ${className}()
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Illegal constructor call.");
}
/**
* Returns the build metadata.
*
* @return The build metadata, if any.
*/
public static String getBuildMetadata() {
if (buildmeta.length() > 0) {
return '+' + buildmeta;
}
return "";
}
}