io.quarkus.cache.runtime.NullValueConverter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-cache Show documentation
Show all versions of quarkus-cache Show documentation
Enable application data caching in CDI beans
package io.quarkus.cache.runtime;
/**
* This class is used to allow the storage of {@code null} values in the Quarkus cache while it is forbidden by the underlying
* caching provider.
*/
public class NullValueConverter {
private static final class NullValue {
public static Object INSTANCE = new NullValue();
}
public static Object toCacheValue(Object value) {
return value == null ? NullValue.INSTANCE : value;
}
public static Object fromCacheValue(Object value) {
return value == NullValue.INSTANCE ? null : value;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy