Minor cleanup in the Metrics module:
* Add missing Javadoc * Line formatting No functional changes.
Showing
3 changed files
with
22 additions
and
3 deletions
... | @@ -24,14 +24,17 @@ public class MetricsComponent implements MetricsComponentRegistry { | ... | @@ -24,14 +24,17 @@ public class MetricsComponent implements MetricsComponentRegistry { |
24 | name = newName; | 24 | name = newName; |
25 | } | 25 | } |
26 | 26 | ||
27 | - @Override public String getName() { | 27 | + @Override |
28 | + public String getName() { | ||
28 | return name; | 29 | return name; |
29 | } | 30 | } |
30 | 31 | ||
31 | - @Override public MetricsFeature registerFeature(final String featureName) { | 32 | + @Override |
33 | + public MetricsFeature registerFeature(final String featureName) { | ||
32 | MetricsFeature feature = featuresRegistry.get(featureName); | 34 | MetricsFeature feature = featuresRegistry.get(featureName); |
33 | if (feature == null) { | 35 | if (feature == null) { |
34 | - final MetricsFeature createdFeature = new MetricsFeature(featureName); | 36 | + final MetricsFeature createdFeature = |
37 | + new MetricsFeature(featureName); | ||
35 | feature = featuresRegistry.putIfAbsent(featureName, createdFeature); | 38 | feature = featuresRegistry.putIfAbsent(featureName, createdFeature); |
36 | if (feature == null) { | 39 | if (feature == null) { |
37 | feature = createdFeature; | 40 | feature = createdFeature; | ... | ... |
... | @@ -4,7 +4,18 @@ package org.onlab.metrics; | ... | @@ -4,7 +4,18 @@ package org.onlab.metrics; |
4 | * Registry Entry for Metrics Components. | 4 | * Registry Entry for Metrics Components. |
5 | */ | 5 | */ |
6 | public interface MetricsComponentRegistry { | 6 | public interface MetricsComponentRegistry { |
7 | + /** | ||
8 | + * Fetches the name of the Component. | ||
9 | + * | ||
10 | + * @return name of the Component | ||
11 | + */ | ||
7 | String getName(); | 12 | String getName(); |
8 | 13 | ||
14 | + /** | ||
15 | + * Registers a Feature for this component. | ||
16 | + * | ||
17 | + * @param featureName name of the Feature to register | ||
18 | + * @return Feature object that can be used when creating Metrics | ||
19 | + */ | ||
9 | MetricsFeature registerFeature(String featureName); | 20 | MetricsFeature registerFeature(String featureName); |
10 | } | 21 | } | ... | ... |
... | @@ -15,6 +15,11 @@ public class MetricsFeature { | ... | @@ -15,6 +15,11 @@ public class MetricsFeature { |
15 | name = newName; | 15 | name = newName; |
16 | } | 16 | } |
17 | 17 | ||
18 | + /** | ||
19 | + * Fetches the name of the Feature. | ||
20 | + * | ||
21 | + * @return name of the Feature | ||
22 | + */ | ||
18 | public String getName() { | 23 | public String getName() { |
19 | return name; | 24 | return name; |
20 | } | 25 | } | ... | ... |
-
Please register or login to post a comment