package net.dean.jraw;

/**
 * This class provides a standard way to version the library
 */
public class Version {
	private static final Version v = new Version(0, 2, 0);

	/**
	 * Returns the current version of the library
	 * @return The current version of the library
	 */
	public static Version get() {
		return v;
	}

	private final int major;
	private final int minor;
	private final int patch;

	private Version(int major, int minor, int patch) {
		this.major = major;
		this.minor = minor;
		this.patch = patch;
	}

	@Override
	public String toString() {
		return "Version {" +
				"major=" + major +
				", minor=" + minor +
				", patch=" + patch +
				'}';
	}

	/**
	 * Generates a formatted string representing this Version in the format of {@code <major>.<minor>.<patch>}
	 * @return A formatted string representing this Version
	 */
	public String formatted() {
		return String.format("%s.%s.%s", major, minor, patch);
	}

	/**
	 * Gets the major version (first number)
	 * @return The major version
	 */
	public int getMajor() {
		return major;
	}

	/**
	 * Gets the minor version (second number)
	 * @return The minor version
	 */
	public int getMinor() {
		return minor;
	}

	/**
	 * Gets the patch version (third number)
	 * @return The patch version
	 */
	public int getPatch() {
		return patch;
	}
}

@@ -394,16 +394,156 @@
 t patch;
+%0A    private final boolean snapshot;%0A%0A    private Version(int major, int minor, int patch) %7B%0A        this(major, minor, patch, false);%0A    %7D
 %0A%0A%09priva
@@ -580,24 +580,42 @@
 r, int patch
+, boolean snapshot
 ) %7B%0A%09%09this.m
@@ -672,16 +672,50 @@
  patch;%0A
+        this.snapshot = snapshot;%0A
 %09%7D%0A%0A%09@Ov
@@ -845,16 +845,59 @@
 patch +%0A
+                %22, snapshot=%22 + snapshot +%0A
 %09%09%09%09'%7D';
@@ -1137,16 +1137,18 @@
 %25s.%25s.%25s
+%25s
 %22, major
@@ -1161,16 +1161,45 @@
 r, patch
+, snapshot ? %22-SNAPSHOT%22 : %22%22
 );%0A%09%7D%0A%0A%09
@@ -1578,10 +1578,12 @@
 tch;%0A%09%7D%0A
+%0A%0A
 %7D%0A

Support for snapshot builds in Version.java