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

fi.evolver.utils.attribute.ContextAttribute Maven / Gradle / Ivy

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