public class VersioningUtils
extends java.lang.Object
Constructor and Description |
---|
VersioningUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> java.util.List<java.lang.reflect.Method> |
getMethodsOfGreaterVersion(T object,
java.lang.String baseVersion)
Creates a list of version annotated methods, greater than a base version, for a given object.
|
static <T> java.util.Map<java.lang.reflect.Method,java.lang.Object> |
getValuesOfMethodsWithGreaterVersion(T object,
java.lang.String baseVersion)
Creates a map of version annotated methods, greater than a base version, for a given object, and the values returned by each method
|
static java.lang.String |
getVersionFromEndpoint(java.net.URL endpoint)
Extracts the Element OS version from a URL endpoint
|
static boolean |
isVersionGreater(java.lang.String baseVersion,
java.lang.String checkedVersion)
Confirms a version string is greater than a base version string
|
static boolean |
isVersionGreaterOrEqual(java.lang.String baseVersion,
java.lang.String checkedVersion)
Confirms a version string is greater than or equal to a base version string
|
static boolean |
isVersionLess(java.lang.String baseVersion,
java.lang.String checkedVersion)
Confirms a version string is less than a base version string
|
static boolean |
isVersionLessOrEqual(java.lang.String baseVersion,
java.lang.String checkedVersion)
Confirms a version string is less than or equal to a base version string
|
static boolean |
isVersionString(java.lang.String possibleVersion)
Checks the format of the version.
|
static <T> java.util.Map<java.lang.String,java.lang.reflect.Constructor<T>> |
mapConstructorVersions(T object)
Creates a map of version annotated constructors for a given object.
|
static <T> java.util.Map<java.lang.String,java.lang.reflect.Constructor<T>> |
mapConstructorVersionsLargerThan(T object,
java.lang.String baseVersion)
Creates a map of version annotated constructors, greater than a base version, for a given object.
|
static java.lang.String |
methodParametersToString(java.util.Collection<java.lang.reflect.Method> methods)
Creates a concatenated string of parameter names, from a collection of methods
|
static java.util.List<java.lang.String> |
transformMethodsToParameterNames(java.util.List<java.lang.reflect.Method> methods)
Creates a list of parameter names from a list of methods
|
public static java.lang.String getVersionFromEndpoint(java.net.URL endpoint)
endpoint
- an Element OS connection endpointpublic static boolean isVersionString(java.lang.String possibleVersion)
possibleVersion
- a possible Version stringpublic static boolean isVersionGreater(java.lang.String baseVersion, java.lang.String checkedVersion)
baseVersion
- the base version for comparisoncheckedVersion
- the version of comparisonpublic static boolean isVersionGreaterOrEqual(java.lang.String baseVersion, java.lang.String checkedVersion)
baseVersion
- the base version for comparisoncheckedVersion
- the version of comparisonpublic static boolean isVersionLess(java.lang.String baseVersion, java.lang.String checkedVersion)
baseVersion
- the base version for comparisoncheckedVersion
- the version of comparisonpublic static boolean isVersionLessOrEqual(java.lang.String baseVersion, java.lang.String checkedVersion)
baseVersion
- the base version for comparisoncheckedVersion
- the version of comparisonpublic static <T> java.util.Map<java.lang.String,java.lang.reflect.Constructor<T>> mapConstructorVersions(T object)
object
- an object with one or more constructors annotated with the @Since annotationpublic static <T> java.util.Map<java.lang.String,java.lang.reflect.Constructor<T>> mapConstructorVersionsLargerThan(T object, java.lang.String baseVersion)
object
- an object with one or more constructors annotated with the @Since annotationbaseVersion
- the base version for comparisonpublic static <T> java.util.List<java.lang.reflect.Method> getMethodsOfGreaterVersion(T object, java.lang.String baseVersion)
object
- an object with one or more methods annotated with the @Since annotationbaseVersion
- the base version for comparisonpublic static <T> java.util.Map<java.lang.reflect.Method,java.lang.Object> getValuesOfMethodsWithGreaterVersion(T object, java.lang.String baseVersion)
object
- an object with one or more methods annotated with the @Since annotationbaseVersion
- the base version for comparisonpublic static java.util.List<java.lang.String> transformMethodsToParameterNames(java.util.List<java.lang.reflect.Method> methods)
methods
- a list of methodspublic static java.lang.String methodParametersToString(java.util.Collection<java.lang.reflect.Method> methods)
methods
- a collection of methods