@Override public Version getMin() { return EmptyVersion.getInstance(); }
@Override public Version getMax() { return EmptyVersion.getInstance(); }
public static Version getRuntimeAPIVersion() { String version = Bootstrap.class.getPackage().getImplementationVersion(); if (version != null) { return SingleVersion.valueOf(version); } return EmptyVersion.getInstance(); }
public static Version getRuntimeAPIVersion() { String version = Bootstrap.class.getPackage().getImplementationVersion(); if (version != null) { return SingleVersion.valueOf(version); } return EmptyVersion.getInstance(); }
/** * Create an {@link AddonId} from the given name, {@link Version}, and API {@link Version}. */ public static AddonId from(String name, Version version, Version apiVersion) { Assert.notNull(name, "Name cannot be null."); if (name.trim().isEmpty()) throw new IllegalArgumentException("Name cannot be empty."); Assert.notNull(version, "Version cannot be null."); if (version.toString().trim().isEmpty()) throw new IllegalArgumentException("Version cannot be empty."); AddonId id = new AddonId(); id.name = name; id.version = version; if (apiVersion == null || apiVersion.toString().trim().isEmpty()) id.apiVersion = EmptyVersion.getInstance(); else id.apiVersion = apiVersion; return id; }
/** * Returns the Implementation version for the given {@link Class} * * @param type the {@link Class} with the corresponding package * @return {@link Version} representation from the {@link Package#getImplementationVersion()} returned from * {@link Class#getPackage()} */ public static Version getImplementationVersionFor(Class<?> type) { Assert.notNull(type, "Type must not be null."); final Version result; Package pkg = type.getPackage(); if (pkg == null) { result = EmptyVersion.getInstance(); } else { String version = pkg.getImplementationVersion(); if (Strings.isNullOrEmpty(version)) { result = EmptyVersion.getInstance(); } else { result = SingleVersion.valueOf(version); } } return result; }
/** * Create an {@link AddonId} from the given name, version, and API version. */ public static AddonId from(String name, String version, String apiVersion) { Assert.notNull(name, "Name cannot be null."); if (name.trim().isEmpty()) throw new IllegalArgumentException("Name cannot be empty."); Assert.notNull(version, "Version cannot be null."); if (version.trim().isEmpty()) throw new IllegalArgumentException("Version cannot be empty."); AddonId id = new AddonId(); id.name = name; id.version = SingleVersion.valueOf(version); if (apiVersion == null || apiVersion.trim().isEmpty()) id.apiVersion = EmptyVersion.getInstance(); else id.apiVersion = SingleVersion.valueOf(apiVersion); return id; }
/** * Returns the Specification version for the given {@link Class} * * @param type the {@link Class} with the corresponding package * @return {@link Version} representation from the {@link Package#getSpecificationVersion()} returned from * {@link Class#getPackage()} */ public static Version getSpecificationVersionFor(Class<?> type) { Assert.notNull(type, "Type must not be null."); final Version result; Package pkg = type.getPackage(); if (pkg == null) { result = EmptyVersion.getInstance(); } else { String version = pkg.getSpecificationVersion(); if (Strings.isNullOrEmpty(version)) { result = EmptyVersion.getInstance(); } else { result = SingleVersion.valueOf(version); } } return result; }
if (resolveAddonAPIVersions && (addonAPIVersion == null || EmptyVersion.getInstance().equals(addonAPIVersion)))