All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.vpro.domain.api.media.Compatibility Maven / Gradle / Ivy

Go to download

Contains the objects used by the Frontend API, like forms and result objects

There is a newer version: 8.3.3
Show newest version
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