0

Added dynamic loading functionality, Updated API to v3.1.0

This commit is contained in:
Pepich
2017-03-29 09:30:15 +02:00
parent 0db0c9b5f6
commit dbca8263a0
2 changed files with 216 additions and 33 deletions

View File

@@ -8,7 +8,7 @@ import com.redstoner.exceptions.MissingVersionException;
/** This class can be used to compare modules against the loader version or against each other to prevent dependency issues.
*
* @author Pepich */
@Version(major = 2, minor = 1, revision = 1, compatible = 0)
@Version(major = 2, minor = 1, revision = 2, compatible = 0)
public final class VersionHelper
{
private VersionHelper()
@@ -86,6 +86,15 @@ public final class VersionHelper
if (!clazz.isAnnotationPresent(Version.class))
throw new MissingVersionException("The given class is not associated with a version.");
Version ver = clazz.getAnnotation(Version.class);
return getString(ver);
}
/** Returns the String representation of a version.
*
* @param ver The version to be represented.
* @return The String representation. */
public static String getString(Version ver)
{
return ver.major() + "." + ver.minor() + "." + ver.revision() + "." + ver.compatible();
}