public interface IAlgorithmConfig
extends org.aeonbits.owner.Mutable
org.aeonbits.owner.Config.ConverterClass, org.aeonbits.owner.Config.DecryptorClass, org.aeonbits.owner.Config.DefaultValue, org.aeonbits.owner.Config.DisableableFeature, org.aeonbits.owner.Config.DisableFeature, org.aeonbits.owner.Config.EncryptedValue, org.aeonbits.owner.Config.HotReload, org.aeonbits.owner.Config.HotReloadType, org.aeonbits.owner.Config.Key, org.aeonbits.owner.Config.LoadPolicy, org.aeonbits.owner.Config.LoadType, org.aeonbits.owner.Config.PreprocessorClasses, org.aeonbits.owner.Config.Separator, org.aeonbits.owner.Config.Sources, org.aeonbits.owner.Config.TokenizerClass| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
K_CPUS |
static java.lang.String |
K_MEMORY |
static java.lang.String |
K_THREADS |
static java.lang.String |
K_TIMEOUT |
| Modifier and Type | Method and Description |
|---|---|
int |
cpus() |
default IAlgorithmConfig |
loadPropertiesFromFile(java.io.File file)
Reads properties of a config from a config file.
|
default IAlgorithmConfig |
loadPropertiesFromList(java.util.List<java.lang.String> propertiesList)
Loads a properties config from a list of property assignments.
|
default IAlgorithmConfig |
loadPropertiesFromResource(java.lang.String resourcePath)
Loads properties from a resource (instead of a file).
|
int |
memory() |
int |
threads() |
long |
timeout() |
static final java.lang.String K_CPUS
static final java.lang.String K_THREADS
static final java.lang.String K_MEMORY
static final java.lang.String K_TIMEOUT
@Config.Key(value="cpus") @Config.DefaultValue(value="8") int cpus()
@Config.Key(value="threads") @Config.DefaultValue(value="-1") int threads()
@Config.Key(value="memory") @Config.DefaultValue(value="256") int memory()
@Config.Key(value="timeout") @Config.DefaultValue(value="-1") long timeout()
default IAlgorithmConfig loadPropertiesFromFile(java.io.File file)
file - The file to read in as properties.java.io.IOException - Throws an IOException if an issue occurs while reading in the properties from the given file.default IAlgorithmConfig loadPropertiesFromResource(java.lang.String resourcePath) throws java.io.IOException
resourcePath - The path to the resource.java.io.IOException - Throws an IOException if an issue occurs while reading in the properties from the given resource.default IAlgorithmConfig loadPropertiesFromList(java.util.List<java.lang.String> propertiesList)
propertiesList - The list of property assignments.