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
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final classBuilds instances of typeImmutableMetricDescriptor.static interfacestatic interfacestatic interfacestatic interface -
Method Summary
Modifier and TypeMethodDescriptionanchor()Instance of the class "containing" this Metric.builder()Creates a builder forImmutableMetricDescriptor.static ImmutableMetricDescriptorcopyOf(MetricDescriptor instance) Creates an immutable copy of aMetricDescriptorvalue.Human readable description of the Metric.booleanThis instance is equal to all instances ofImmutableMetricDescriptorthat have equal attribute values.inthashCode()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 valueMetricDescriptorwith attribute values.withAnchor(Object value) Copy the current immutable object by setting a value for theanchorattribute.withDescription(String value) Copy the current immutable object by setting a value for thedescriptionattribute.Copy the current immutable object by setting a value for theidattribute.withModule(String value) Copy the current immutable object by setting a value for themoduleattribute.withProject(String value) Copy the current immutable object by setting a value for theprojectattribute.Methods inherited from class org.opendaylight.serviceutils.metrics.MetricDescriptor
check
-
Method Details
-
anchor
Instance of the class "containing" this Metric.- Specified by:
anchorin 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:
projectin 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:
modulein 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:
idin 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:
descriptionin classMetricDescriptor
-
withAnchor
Copy the current immutable object by setting a value for theanchorattribute. 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
thisobject
-
withProject
Copy the current immutable object by setting a value for theprojectattribute. 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
thisobject
-
withModule
Copy the current immutable object by setting a value for themoduleattribute. 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
thisobject
-
withId
Copy the current immutable object by setting a value for theidattribute. 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
thisobject
-
withDescription
Copy the current immutable object by setting a value for thedescriptionattribute. 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
thisobject
-
equals
This instance is equal to all instances ofImmutableMetricDescriptorthat have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:anchor,project,module,id,description. -
toString
Prints the immutable valueMetricDescriptorwith attribute values. -
copyOf
Creates an immutable copy of aMetricDescriptorvalue. 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) // requiredanchor.project(String) // requiredproject.module(String) // requiredmodule.id(String) // requiredid.description(String) // optionaldescription.build();- Returns:
- A new ImmutableMetricDescriptor builder
-