uk.autores.handling.CfgStrategy Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of annotations Show documentation
Show all versions of annotations Show documentation
Annotation driven library for handling embedded resources
// Copyright 2023 https://github.com/autores-uk/autores/blob/main/LICENSE.txt
// SPDX-License-Identifier: Apache-2.0
package uk.autores.handling;
/**
* "strategy": how to consume resources.
*
* - "inline": embed in class files
* - "const": embed in class file constant pool
* - "lazy": load resources using {@link ClassLoader}
* - "auto": use some heuristic to decide loading strategy
*
*/
public final class CfgStrategy {
/** Key */
public static final String STRATEGY = "strategy";
/** Value */
public static final String AUTO = "auto";
/** Value */
public static final String INLINE = "inline";
/** Value */
public static final String LAZY = "lazy";
/** Value */
public static final String CONST = "const";
/**
* Config definition.
* @see ConfigDef
* @see ResourceFiles#config()
*/
public static final ConfigDef DEF = new ConfigDef(STRATEGY, s -> s.matches(
AUTO + '|' + INLINE + '|' + LAZY + '|' + CONST
));
private CfgStrategy() {}
}