<#include "parts/package_part.tpl">import java.util.Properties; import java.util.ResourceBundle; import java.util.function.UnaryOperator; import javax.annotation.processing.Generated; /** * Property keys from ${fileName} * {@link #getValue()} gives the key for the entry, with {@link #getText()} the value for the key is given directly. * This enum needs to be initialized before any use by {@link #init(UnaryOperator)}. */ <#include "parts/enum_head_values.tpl"> private static UnaryOperator function; private final String value; private ${classname} (String value) { this.value = value; } public static void init(UnaryOperator resourceFunction) { function = resourceFunction; } /** * Represented Key in property File. * @return key */ public String getValue() { return value; } /** * Resolves the value for this key. * {@link #init(UnaryOperator)} must be called before. */ public String getText() { return function.apply(value); } /** * Resolves the value for this key from the parameter function. *

* e.g. ${classname}.getString(resBundle::getString) * @param resourceFunction {@link Properties#getProperty(String)} or {@link ResourceBundle#getString(String)} * @return */ public String getString(UnaryOperator resourceFunction) { return resourceFunction.apply(value); } }