Class ImmutableMetricDescriptor
java.lang.Object
org.opendaylight.serviceutils.metrics.MetricDescriptor
org.opendaylight.serviceutils.metrics.ImmutableMetricDescriptor
@Generated("org.immutables.processor.ProxyProcessor")
public final class ImmutableMetricDescriptor
extends MetricDescriptor
Immutable implementation of
MetricDescriptor
.
Use the builder to create immutable instances:
ImmutableMetricDescriptor.builder()
.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
static final class
Builds instances of typeImmutableMetricDescriptor
.static interface
static interface
static interface
static interface
-
Method Summary
Modifier and TypeMethodDescriptionanchor()
Instance of the class "containing" this Metric.builder()
Creates a builder forImmutableMetricDescriptor
.static ImmutableMetricDescriptor
copyOf
(MetricDescriptor instance) Creates an immutable copy of aMetricDescriptor
value.Human readable description of the Metric.boolean
This instance is equal to all instances ofImmutableMetricDescriptor
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:anchor
,project
,module
,id
,description
.id()
module()
Name of OpenDaylight module the Metric is for, unique within givenproject()
.project()
Name of OpenDaylight project the Metric is for, unique at opendaylight.org.toString()
Prints the immutable valueMetricDescriptor
with attribute values.withAnchor
(Object value) Copy the current immutable object by setting a value for theanchor
attribute.withDescription
(String value) Copy the current immutable object by setting a value for thedescription
attribute.Copy the current immutable object by setting a value for theid
attribute.withModule
(String value) Copy the current immutable object by setting a value for themodule
attribute.withProject
(String value) Copy the current immutable object by setting a value for theproject
attribute.Methods inherited from class org.opendaylight.serviceutils.metrics.MetricDescriptor
check
-
Method Details
-
anchor
Instance of the class "containing" this Metric.- Specified by:
anchor
in classMetricDescriptor
-
project
Name of OpenDaylight project the Metric is for, unique at opendaylight.org. E.g. "netvirt" or "genius" or "openflowplugin" or "infrautils" etc. The project/module/id together must be unique within ODL. Valid values match[a-z0-9]+
(lower case and no dots nor underscores).- Specified by:
project
in classMetricDescriptor
-
module
Name of OpenDaylight module the Metric is for, unique within givenproject()
. E.g. "vpnmanager" or "lockmanager" or "jobcoordinator" etc. The project/module/id together must be unique within ODL. Valid values match[a-z0-9]+
(lower case and no dots nor underscores).- Specified by:
module
in classMetricDescriptor
-
id
ID of the Metric, unique within givenproject()
+module()
. E.g. "jobsPending" or "dropped_packets" or "traffic" etc. The project/module/id together must be unique within ODL. Valid values match[a-zA-Z0-9_]+
(lower and upper case and underscore allowed, but not starting with). The dot character is not allowed here because at least one of the implementations (Prometheus.io) does not accept dots in its IDs.- Specified by:
id
in classMetricDescriptor
-
description
Human readable description of the Metric. E.g. "Counts the number of bla bla bla". No validation of valid values; anything goes. Defaults to be the same as id(); but highly recommended to be set so that external Dashboard type UIs can show it as documentation or help for this Metric.- Overrides:
description
in classMetricDescriptor
-
withAnchor
Copy the current immutable object by setting a value for theanchor
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for anchor- Returns:
- A modified copy of the
this
object
-
withProject
Copy the current immutable object by setting a value for theproject
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for project- Returns:
- A modified copy of the
this
object
-
withModule
Copy the current immutable object by setting a value for themodule
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for module- Returns:
- A modified copy of the
this
object
-
withId
Copy the current immutable object by setting a value for theid
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for id- Returns:
- A modified copy of the
this
object
-
withDescription
Copy the current immutable object by setting a value for thedescription
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for description- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableMetricDescriptor
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:anchor
,project
,module
,id
,description
. -
toString
Prints the immutable valueMetricDescriptor
with attribute values. -
copyOf
Creates an immutable copy of aMetricDescriptor
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable MetricDescriptor instance
-
builder
Creates a builder forImmutableMetricDescriptor
.ImmutableMetricDescriptor.builder() .anchor(Object) // required
anchor
.project(String) // requiredproject
.module(String) // requiredmodule
.id(String) // requiredid
.description(String) // optionaldescription
.build();- Returns:
- A new ImmutableMetricDescriptor builder
-