Class DiagnosticOptions
java.lang.Object
java.util.AbstractMap<String,Object>
java.util.HashMap<String,Object>
org.refcodes.ontology.Taxonomy
org.refcodes.runtime.Settings
org.refcodes.runtime.Options
org.refcodes.runtime.DiagnosticOptions
- All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, Clearable, EmptyAccessor, org.refcodes.ontology.Ontology, Diagnosable, Schemable<DiagnosticOptions>, Containable, ImmutableTable<String, Object>, ImmutableTable.MutableTable<String, Object>, Keys<String, Object>, Keys.MutableKeys<String, Object>, Keys.MutableValues<String, Object>
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
DiagnosticOption.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 ClassesNested classes/interfaces inherited from class Settings
Settings.Node, Settings.Properties, Settings.RootNested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> Nested classes/interfaces inherited from interface EmptyAccessor
EmptyAccessor.EmptyBuilder<B>, EmptyAccessor.EmptyMutator, EmptyAccessor.EmptyPropertyNested classes/interfaces inherited from interface ImmutableTable
ImmutableTable.MutableTable<K,V> Nested classes/interfaces inherited from interface Keys
Keys.MutableKeys<K,V>, Keys.MutableValues<K, V> -
Field Summary
Fields inherited from class org.refcodes.ontology.Taxonomy
NAMESPACE_SEPARATOR -
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 Settings
createResult, fromNamespace, merge, ofNamespace, removeNamespace, toSchema, toSchema, transformKeys, transformValuesMethods inherited from class org.refcodes.ontology.Taxonomy
contains, containsNamespace, get, get, get, get, getOr, namespaces, put, put, remove, toKey, toNormalizedMethods inherited from class 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 AbstractMap
equals, hashCode, toStringMethods inherited from interface Containable
sizeMethods inherited from interface EmptyAccessor
isEmptyMethods inherited from interface ImmutableTable.MutableTable
delete, putMethods inherited from interface Keys
containsKey, containsValue, getOr, keySet, valuesMethods inherited from interface Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesMethods inherited from interface org.refcodes.ontology.Ontology
get, get, getOr, getOr, getOr
-
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
-