
fi.evolver.utils.attribute.ContextAttribute Maven / Gradle / Ivy
package fi.evolver.utils.attribute;
import java.util.Optional;
import fi.evolver.utils.ContextUtils;
/**
* A helper class for handling context attributes in a type safe manner.
*/
public record ContextAttribute(String name, Class type) implements TypedAttribute {
@Override
public Optional get() {
return ContextUtils.get(name, type);
}
@Override
public void set(T value) {
ContextUtils.put(name, value);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy