Class DiagnosticOptions
java.lang.Object
java.util.AbstractMap<String,Object>
java.util.HashMap<String,Object>
org.refcodes.runtime.Options
org.refcodes.runtime.DiagnosticOptions
- All Implemented Interfaces:
Serializable,Cloneable,Map<String,,Object> Diagnosable,org.refcodes.schema.Schemable<DiagnosticOptions>
The
DiagnosticOptions represent a set of options influencing how a
Diagnosable instance renders its runtime diagnostics Schema.
The options are expressed as key/value pairs and stored internally in a
Map. In addition to generic map-style access, this class provides
typed convenience accessors for commonly used options such as
DiagnosticOptions.Configuration.DIAGNOSTICS_LIMIT.
The interpretation of individual option keys and values is intentionally left
to the respective Schemable implementation. This makes the
DiagnosticOptions generic and reusable across different domains and
schema-producing components.
Instances of this class are typically created using the nested
DiagnosticOptions.Builder.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder for creatingDiagnosticOptionsinstances.static enumTheDiagnosticOptions.Configurationenumeration defines known options supported by this class.Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDiagnosticOptions(DiagnosticOptions.Builder aBuilder) Instantiates a new instance from the given builder. -
Method Summary
Modifier and TypeMethodDescriptionstatic DiagnosticOptions.Builderbuilder()Creates a newDiagnosticOptions.Builderfor constructingDiagnosticOptionsinstances.intgetLimit()Returns the configured limit value.intgetLimitOr(int aValue) Returns the configured limit value or the provided default.Methods inherited from class org.refcodes.runtime.Options
get, get, get, get, getOption, getOr, getOr, getOr, put, put, registerOptions, toSchema, toSchemaMethods inherited from class java.util.HashMap
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, newHashMap, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from class java.util.AbstractMap
equals, hashCode, toString
-
Constructor Details
-
DiagnosticOptions
Instantiates a new instance from the given builder.- Parameters:
aBuilder- The builder from which to populate the this instance.
-
-
Method Details
-
getLimit
public int getLimit()Returns the configured limit value.
This is a convenience method equivalent to calling
getLimitOr(int)with-1as the default value.- Returns:
- the configured limit value, or
-1if no limit is set
-
getLimitOr
public int getLimitOr(int aValue) Returns the configured limit value or the provided default.- Parameters:
aValue- the default value to return if no limit is present- Returns:
- the configured limit value or
aValueif absent
-
builder
Creates a newDiagnosticOptions.Builderfor constructingDiagnosticOptionsinstances.- Returns:
- a new builder instance
-