Pavlin Radoslavov

Minor cleanup in the Metrics module:

 * Add missing Javadoc
 * Line formatting

No functional changes.
......@@ -24,14 +24,17 @@ public class MetricsComponent implements MetricsComponentRegistry {
name = newName;
}
@Override public String getName() {
@Override
public String getName() {
return name;
}
@Override public MetricsFeature registerFeature(final String featureName) {
@Override
public MetricsFeature registerFeature(final String featureName) {
MetricsFeature feature = featuresRegistry.get(featureName);
if (feature == null) {
final MetricsFeature createdFeature = new MetricsFeature(featureName);
final MetricsFeature createdFeature =
new MetricsFeature(featureName);
feature = featuresRegistry.putIfAbsent(featureName, createdFeature);
if (feature == null) {
feature = createdFeature;
......
......@@ -4,7 +4,18 @@ package org.onlab.metrics;
* Registry Entry for Metrics Components.
*/
public interface MetricsComponentRegistry {
/**
* Fetches the name of the Component.
*
* @return name of the Component
*/
String getName();
/**
* Registers a Feature for this component.
*
* @param featureName name of the Feature to register
* @return Feature object that can be used when creating Metrics
*/
MetricsFeature registerFeature(String featureName);
}
......
......@@ -15,6 +15,11 @@ public class MetricsFeature {
name = newName;
}
/**
* Fetches the name of the Feature.
*
* @return name of the Feature
*/
public String getName() {
return name;
}
......