Package com.exedio.cope.util
Class Properties
java.lang.Object
com.exedio.cope.util.Properties
- Direct Known Subclasses:
DispatcherProperties
,FactoryProperties
,PoolProperties
,SamplerProperties
,VaultProperties
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
Properties.Factory<T extends Properties>
final class
static @interface
Declares a method to be a probe.static final class
static final class
Properties.PropertiesField<T extends Properties>
static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Properties.Source
Deprecated.static final Properties.Source
Deprecated.UseSources.SYSTEM_PROPERTIES
instead -
Constructor Summary
ConstructorsConstructorDescriptionProperties
(Properties.Source source) Properties
(Properties.Source source, Properties.Source context) Deprecated.UseProperties(Source)
instead.Properties
(Properties source, String sourceDescription) Deprecated.UseProperties(Source, Source)
instead.Properties
(Properties source, String sourceDescription, Properties.Source context) Deprecated.UseProperties(Source, Source)
instead. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
ensureEquality
(Properties other) final void
ensureValidity
(String... prefixes) protected final Properties.Field<Boolean>
Deprecated.Usevalue(String, boolean)
insteadprotected final Properties.Field<Integer>
Deprecated.Usevalue(String, int, int)
insteadprotected final Properties.Field<Day>
Deprecated.Usevalue(String, Day)
insteadprotected final <T extends Properties>
Properties.PropertiesField<T>field
(String key, Properties.Factory<T> factory) Deprecated.Usevalue(String, Factory)
insteadprotected final Properties.Field<String>
Deprecated.Usevalue(String, String)
insteadprotected final Properties.Field<File>
Deprecated.UsevalueFile(String)
insteadfinal Properties.Source
final String
getContext
(String key) Deprecated.UsegetContext()
instead.static final Properties.Source
getContext
(Properties properties, String description) Deprecated.UsegetSource(java.util.Properties,String)
insteadfinal Properties.Field<?>
final List<Properties.Field<?>>
Returns all probes of this properties instance.final String
static final Properties.Source
Deprecated.UseSources.load(File)
instead.static final Properties.Source
getSource
(Properties properties, String description) Deprecated.UseSources.view(java.util.Properties, String)
instead.final Properties.Source
static final Properties.Source
Deprecated.UseSources.SYSTEM_PROPERTIES
insteadstatic final Properties.Source
Deprecated.UseSources.SYSTEM_PROPERTIES
insteadgetTests()
Deprecated.UseProperties.Probe
insteadstatic final Properties
loadProperties
(File file) Deprecated.UseSources.loadProperties(File)
instead.protected final IllegalPropertiesException
newException
(String key, String detail) protected final IllegalPropertiesException
newException
(String key, String detail, Throwable cause) protected final Properties.ProbeAbortedException
newProbeAbortedException
(String message) protected final <T extends Properties>
Tvalnp
(String key, Properties.Factory<T> factory) Replacement forvalue(String, Factory)
to avoid javac problem:protected final boolean
protected final <T extends Properties>
Tvalue
(String key, boolean enabledDefault, Properties.Factory<T> factory) protected final int
protected final Day
protected final <T extends Properties>
Tvalue
(String key, Properties.Factory<T> factory) If calling this method causes javac problem:error: reference to value is ambiguous
, usevalnp(String, Factory)
instead.protected final <E extends Enum<E>>
Eprotected final <E extends Enum<E>>
Eprotected final String
protected final Charset
protected final Duration
protected final Duration
protected final ZoneId
protected final File
protected final String
valueHidden
(String key, String defaultValue) protected final MessageDigestFactory
valueMessageDigest
(String key, String defaultValue) protected final Path
protected final <T,
P> ServiceFactory<T, P> valueService
(String key, Class<? extends T> defaultValue, Class<T> superclass, Class<P> parameterType) protected final <T,
P> ServiceFactory<T, P> valueService
(String key, Class<T> superclass, Class<P> parameterType) Implementations ofsuperclass
to be instantiated byServiceFactory.newInstance(Object)
must have a suitable constructor: The type of the first parameter is specified by parameterparameterType
of this method.protected final <T,
P> ServiceFactory<T, P> valueService
(String key, String defaultValue, Class<T> superclass, Class<P> parameterType)
-
Field Details
-
EMPTY_SOURCE
Deprecated.UseSources.EMPTY
instead -
SYSTEM_PROPERTY_SOURCE
Deprecated.UseSources.SYSTEM_PROPERTIES
instead
-
-
Constructor Details
-
Properties
-
Properties
Deprecated.UseProperties(Source)
instead. Using context is deprecated at all. -
Properties
Deprecated.UseProperties(Source, Source)
instead. -
Properties
@Deprecated public Properties(Properties source, String sourceDescription, Properties.Source context) Deprecated.UseProperties(Source, Source)
instead.
-
-
Method Details
-
getTests
Deprecated.UseProperties.Probe
insteadThis default implementation returnsgetProbes()
. -
getField
-
getFields
-
getSourceObject
-
getSource
-
getContext
- Throws:
IllegalStateException
- if there is no context for these properties.
-
value
-
field
Deprecated.Usevalue(String, boolean)
instead -
value
-
field
@Deprecated protected final Properties.Field<Integer> field(String key, int defaultValue, int minimum) Deprecated.Usevalue(String, int, int)
instead -
value
-
field
Deprecated.Usevalue(String, Day)
instead -
value
-
valueHidden
-
field
Deprecated.Usevalue(String, String)
instead -
valuePath
-
valueFile
-
fieldFile
Deprecated.UsevalueFile(String)
instead -
value
-
value
-
value
-
value
-
value
-
value
-
valueMessageDigest
-
valueService
protected final <T,P> ServiceFactory<T,P> valueService(String key, Class<T> superclass, Class<P> parameterType) Implementations ofsuperclass
to be instantiated byServiceFactory.newInstance(Object)
must have a suitable constructor: The type of the first parameter is specified by parameterparameterType
of this method. The type of the second parameter is specified by annotation @ServiceProperties
at the implementation class. If there is no such annotation, the constructor must have one parameter only. Please note that @ServiceProperties
could beinherited
from a superclass. -
valueService
protected final <T,P> ServiceFactory<T,P> valueService(String key, Class<? extends T> defaultValue, Class<T> superclass, Class<P> parameterType) -
valueService
protected final <T,P> ServiceFactory<T,P> valueService(String key, String defaultValue, Class<T> superclass, Class<P> parameterType) -
value
If calling this method causes javac problem:error: reference to value is ambiguous
, usevalnp(String, Factory)
instead. -
valnp
Replacement forvalue(String, Factory)
to avoid javac problem:error: reference to value is ambiguous
https://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8170842
-
value
protected final <T extends Properties> T value(String key, boolean enabledDefault, Properties.Factory<T> factory) -
field
@Deprecated protected final <T extends Properties> Properties.PropertiesField<T> field(String key, Properties.Factory<T> factory) Deprecated.Usevalue(String, Factory)
instead -
newException
-
newException
-
getOrphanedKeys
-
ensureValidity
-
ensureEquality
-
newProbeAbortedException
-
getProbes
Returns all probes of this properties instance. Probes are methods annotated byProperties.Probe
. The result includes probes of super classes and probes ofnested
properties.- See Also:
-
getContext
Deprecated.UsegetContext()
instead.- Throws:
IllegalArgumentException
- if the context does not contain a value forkey
.IllegalStateException
- if there is no context for these properties.
-
getSystemPropertySource
Deprecated.UseSources.SYSTEM_PROPERTIES
instead -
getSystemPropertyContext
Deprecated.UseSources.SYSTEM_PROPERTIES
instead -
getContext
@Deprecated public static final Properties.Source getContext(Properties properties, String description) Deprecated.UsegetSource(java.util.Properties,String)
instead -
getSource
@Deprecated public static final Properties.Source getSource(Properties properties, String description) Deprecated.UseSources.view(java.util.Properties, String)
instead. -
getSource
Deprecated.UseSources.load(File)
instead. -
loadProperties
Deprecated.UseSources.loadProperties(File)
instead.
-
Sources.EMPTY
instead