nl.vpro.domain.api.media.Compatibility Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of api-domain Show documentation
Show all versions of api-domain Show documentation
Contains the objects used by the Frontend API, like forms and result objects
package nl.vpro.domain.api.media;
import nl.vpro.util.IntegerVersion;
/**
* @author Michiel Meeuwissen
* @since 5.5
*/
public class Compatibility {
private static final ThreadLocal compatibility = ThreadLocal.withInitial(() -> null);
private Compatibility() {
}
public static void setCompatibility(IntegerVersion value) {
compatibility.set(value);
}
public static void clearCompatibility() {
compatibility.remove();
}
public static boolean compatibleBefore(IntegerVersion version) {
if (compatibility.get() == null) {
return true;
}
return version.isBefore(compatibility.get());
}
public static boolean versionBefore(IntegerVersion version) {
if (compatibility.get() == null) {
return false;
}
return compatibility.get().isBefore(version);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy