Class DiagnosticOptions

All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>, Diagnosable, org.refcodes.schema.Schemable<DiagnosticOptions>

public class DiagnosticOptions extends Options
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:
  • Constructor Details

    • DiagnosticOptions

      protected DiagnosticOptions(DiagnosticOptions.Builder aBuilder)
      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 -1 as the default value.

      Returns:
      the configured limit value, or -1 if 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 aValue if absent
    • builder

      public static DiagnosticOptions.Builder builder()
      Creates a new DiagnosticOptions.Builder for constructing DiagnosticOptions instances.
      Returns:
      a new builder instance