Class ImmutableMetricDescriptor
- java.lang.Object
 - 
- org.opendaylight.infrautils.metrics.MetricDescriptor
 - 
- org.opendaylight.infrautils.metrics.ImmutableMetricDescriptor
 
 
 
- 
@Generated("org.immutables.processor.ProxyProcessor") public final class ImmutableMetricDescriptor extends MetricDescriptor
Immutable implementation ofMetricDescriptor.Use the builder to create immutable instances:
ImmutableMetricDescriptor.builder(). 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceImmutableMetricDescriptor.AnchorBuildStagestatic classImmutableMetricDescriptor.BuilderBuilds instances of typeImmutableMetricDescriptor.static interfaceImmutableMetricDescriptor.BuildFinalstatic interfaceImmutableMetricDescriptor.IdBuildStagestatic interfaceImmutableMetricDescriptor.ModuleBuildStagestatic interfaceImmutableMetricDescriptor.ProjectBuildStage 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectanchor()Instance of the class "containing" this Metric.static ImmutableMetricDescriptor.AnchorBuildStagebuilder()Creates a builder forImmutableMetricDescriptor.static ImmutableMetricDescriptorcopyOf(MetricDescriptor instance)Creates an immutable copy of aMetricDescriptorvalue.Stringdescription()Human readable description of the Metric.booleanequals(Object another)This instance is equal to all instances ofImmutableMetricDescriptorthat have equal attribute values.inthashCode()Computes a hash code from attributes:anchor,project,module,id,description.Stringid()Stringmodule()Name of OpenDaylight module the Metric is for, unique within givenproject().Stringproject()Name of OpenDaylight project the Metric is for, unique at opendaylight.org.StringtoString()Prints the immutable valueMetricDescriptorwith attribute values.ImmutableMetricDescriptorwithAnchor(Object value)Copy the current immutable object by setting a value for theanchorattribute.ImmutableMetricDescriptorwithDescription(String value)Copy the current immutable object by setting a value for thedescriptionattribute.ImmutableMetricDescriptorwithId(String value)Copy the current immutable object by setting a value for theidattribute.ImmutableMetricDescriptorwithModule(String value)Copy the current immutable object by setting a value for themoduleattribute.ImmutableMetricDescriptorwithProject(String value)Copy the current immutable object by setting a value for theprojectattribute.- 
Methods inherited from class org.opendaylight.infrautils.metrics.MetricDescriptor
check 
 - 
 
 - 
 
- 
- 
Method Detail
- 
anchor
public Object anchor()
Instance of the class "containing" this Metric.- Specified by:
 anchorin classMetricDescriptor
 
- 
project
public String 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
public String 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
public String 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
public String 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
public final ImmutableMetricDescriptor withAnchor(Object value)
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
public final ImmutableMetricDescriptor withProject(String value)
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
public final ImmutableMetricDescriptor withModule(String value)
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
public final ImmutableMetricDescriptor withId(String value)
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
public final ImmutableMetricDescriptor withDescription(String value)
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
public boolean equals(Object another)
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
public String toString()
Prints the immutable valueMetricDescriptorwith attribute values. 
- 
copyOf
public static ImmutableMetricDescriptor copyOf(MetricDescriptor instance)
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
public static ImmutableMetricDescriptor.AnchorBuildStage 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
 
 
 - 
 
 -