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 interfaceProperties.Factory<T extends Properties>final classstatic @interfaceDeclares a method to be a probe.static final classstatic final classProperties.PropertiesField<T extends Properties>static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Properties.SourceDeprecated.static final Properties.SourceDeprecated.UseSources.SYSTEM_PROPERTIESinstead -
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 voidensureEquality(Properties other) final voidensureValidity(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.Sourcefinal StringgetContext(String key) Deprecated.UsegetContext()instead.static final Properties.SourcegetContext(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 Stringstatic final Properties.SourceDeprecated.UseSources.load(File)instead.static final Properties.SourcegetSource(Properties properties, String description) Deprecated.UseSources.view(java.util.Properties, String)instead.final Properties.Sourcestatic final Properties.SourceDeprecated.UseSources.SYSTEM_PROPERTIESinsteadstatic final Properties.SourceDeprecated.UseSources.SYSTEM_PROPERTIESinsteadgetTests()Deprecated.UseProperties.Probeinsteadstatic final PropertiesloadProperties(File file) Deprecated.UseSources.loadProperties(File)instead.protected final IllegalPropertiesExceptionnewException(String key, String detail) protected final IllegalPropertiesExceptionnewException(String key, String detail, Throwable cause) protected final Properties.ProbeAbortedExceptionnewProbeAbortedException(String message) protected final <T extends Properties>
Tvalnp(String key, Properties.Factory<T> factory) Replacement forvalue(String, Factory)to avoid javac problem:protected final booleanprotected final <T extends Properties>
Tvalue(String key, boolean enabledDefault, Properties.Factory<T> factory) protected final intprotected final Dayprotected 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 Stringprotected final Charsetprotected final Durationprotected final Durationprotected final ZoneIdprotected final Fileprotected final StringvalueHidden(String key, String defaultValue) protected final MessageDigestFactoryvalueMessageDigest(String key, String defaultValue) protected final Pathprotected 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 ofsuperclassto be instantiated byServiceFactory.newInstance(Object)must have a suitable constructor: The type of the first parameter is specified by parameterparameterTypeof 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.EMPTYinstead -
SYSTEM_PROPERTY_SOURCE
Deprecated.UseSources.SYSTEM_PROPERTIESinstead
-
-
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.ProbeinsteadThis 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 ofsuperclassto be instantiated byServiceFactory.newInstance(Object)must have a suitable constructor: The type of the first parameter is specified by parameterparameterTypeof this method. The type of the second parameter is specified by annotation @ServicePropertiesat the implementation class. If there is no such annotation, the constructor must have one parameter only. Please note that @ServicePropertiescould beinheritedfrom 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 ambiguoushttps://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 ofnestedproperties.- 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_PROPERTIESinstead -
getSystemPropertyContext
Deprecated.UseSources.SYSTEM_PROPERTIESinstead -
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.EMPTYinstead