Class ImmutableMetricDescriptor.Builder
java.lang.Object
org.opendaylight.serviceutils.metrics.ImmutableMetricDescriptor.Builder
- All Implemented Interfaces:
ImmutableMetricDescriptor.AnchorBuildStage
,ImmutableMetricDescriptor.BuildFinal
,ImmutableMetricDescriptor.IdBuildStage
,ImmutableMetricDescriptor.ModuleBuildStage
,ImmutableMetricDescriptor.ProjectBuildStage
- Enclosing class:
ImmutableMetricDescriptor
public static final class ImmutableMetricDescriptor.Builder
extends Object
implements ImmutableMetricDescriptor.AnchorBuildStage, ImmutableMetricDescriptor.ProjectBuildStage, ImmutableMetricDescriptor.ModuleBuildStage, ImmutableMetricDescriptor.IdBuildStage, ImmutableMetricDescriptor.BuildFinal
Builds instances of type
ImmutableMetricDescriptor
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionInitializes the value for theanchor
attribute.build()
Builds a newImmutableMetricDescriptor
.description
(String description) Initializes the value for thedescription
attribute.Initializes the value for theid
attribute.Initializes the value for themodule
attribute.Initializes the value for theproject
attribute.
-
Method Details
-
anchor
Initializes the value for theanchor
attribute.- Specified by:
anchor
in interfaceImmutableMetricDescriptor.AnchorBuildStage
- Parameters:
anchor
- The value for anchor- Returns:
this
builder for use in a chained invocation
-
project
Initializes the value for theproject
attribute.- Specified by:
project
in interfaceImmutableMetricDescriptor.ProjectBuildStage
- Parameters:
project
- The value for project- Returns:
this
builder for use in a chained invocation
-
module
Initializes the value for themodule
attribute.- Specified by:
module
in interfaceImmutableMetricDescriptor.ModuleBuildStage
- Parameters:
module
- The value for module- Returns:
this
builder for use in a chained invocation
-
id
Initializes the value for theid
attribute.- Specified by:
id
in interfaceImmutableMetricDescriptor.IdBuildStage
- Parameters:
id
- The value for id- Returns:
this
builder for use in a chained invocation
-
description
@CanIgnoreReturnValue public final ImmutableMetricDescriptor.Builder description(String description) Initializes the value for thedescription
attribute.If not set, this attribute will have a default value as returned by the initializer of
description
.- Specified by:
description
in interfaceImmutableMetricDescriptor.BuildFinal
- Parameters:
description
- The value for description- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableMetricDescriptor
.- Specified by:
build
in interfaceImmutableMetricDescriptor.BuildFinal
- Returns:
- An immutable instance of MetricDescriptor
- Throws:
IllegalStateException
- if any required attributes are missing
-