io.quarkus.resteasy.reactive.links.runtime.GetterAccessorsContainer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-rest-links Show documentation
Show all versions of quarkus-rest-links Show documentation
Web Links support for Quarkus REST. Inject web links into response HTTP headers by annotating your endpoint resources.
package io.quarkus.resteasy.reactive.links.runtime;
import java.util.HashMap;
import java.util.Map;
/**
* Utility class that allows us to easily find a {@code GetterAccessor} based on a type and a field name.
*/
public class GetterAccessorsContainer {
private final Map> getterAccessors = new HashMap<>();
public GetterAccessor get(String className, String fieldName) {
return getterAccessors.get(className).get(fieldName);
}
public void put(String className, String fieldName, GetterAccessor getterAccessor) {
if (!getterAccessors.containsKey(className)) {
getterAccessors.put(className, new HashMap<>());
}
Map getterAccessorsByField = getterAccessors.get(className);
if (!getterAccessorsByField.containsKey(fieldName)) {
getterAccessorsByField.put(fieldName, getterAccessor);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy