Skip to content

Commit

Permalink
Rename base classes to abstract class (#832)
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Cristian Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Feb 7, 2020
1 parent e9a44a2 commit 7a832e6
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@

import io.opentelemetry.metrics.LabelSet;

class BaseBoundInstrument {
class AbstractBoundInstrument {
private final LabelSet labels;

BaseBoundInstrument(LabelSet labels) {
AbstractBoundInstrument(LabelSet labels) {
this.labels = labels;
// todo: associate with an aggregator/accumulator
}
Expand All @@ -31,11 +31,11 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof BaseBoundInstrument)) {
if (!(o instanceof AbstractBoundInstrument)) {
return false;
}

BaseBoundInstrument that = (BaseBoundInstrument) o;
AbstractBoundInstrument that = (AbstractBoundInstrument) o;

return labels.equals(that.labels);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;
import java.util.Map;

abstract class BaseInstrument implements Instrument {
abstract class AbstractInstrument implements Instrument {

private final String name;
private final String description;
Expand All @@ -29,7 +29,7 @@ abstract class BaseInstrument implements Instrument {
private final List<String> labelKeys;

// All arguments cannot be null because they are checked in the abstract builder classes.
BaseInstrument(
AbstractInstrument(
String name,
String description,
String unit,
Expand All @@ -47,11 +47,11 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
if (!(o instanceof BaseInstrument)) {
if (!(o instanceof AbstractInstrument)) {
return false;
}

BaseInstrument that = (BaseInstrument) o;
AbstractInstrument that = (AbstractInstrument) o;

return name.equals(that.name)
&& description.equals(that.description)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
package io.opentelemetry.sdk.metrics;

import io.opentelemetry.metrics.DoubleCounter;
import io.opentelemetry.metrics.DoubleCounter.BoundDoubleCounter;
import io.opentelemetry.metrics.LabelSet;
import java.util.List;
import java.util.Map;

final class DoubleCounterSdk extends BaseInstrument implements DoubleCounter {
final class DoubleCounterSdk extends AbstractInstrument implements DoubleCounter {

private final boolean monotonic;

Expand Down Expand Up @@ -76,7 +75,7 @@ public int hashCode() {
return result;
}

private static final class Bound extends BaseBoundInstrument implements BoundDoubleCounter {
private static final class Bound extends AbstractBoundInstrument implements BoundDoubleCounter {

private final boolean monotonic;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,11 @@
package io.opentelemetry.sdk.metrics;

import io.opentelemetry.metrics.DoubleMeasure;
import io.opentelemetry.metrics.DoubleMeasure.BoundDoubleMeasure;
import io.opentelemetry.metrics.LabelSet;
import java.util.List;
import java.util.Map;

final class DoubleMeasureSdk extends BaseInstrument implements DoubleMeasure {
final class DoubleMeasureSdk extends AbstractInstrument implements DoubleMeasure {

private final boolean absolute;

Expand Down Expand Up @@ -76,7 +75,7 @@ public int hashCode() {
return result;
}

private static final class Bound extends BaseBoundInstrument implements BoundDoubleMeasure {
private static final class Bound extends AbstractBoundInstrument implements BoundDoubleMeasure {

private final boolean absolute;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;
import java.util.Map;

final class DoubleObserverSdk extends BaseInstrument implements DoubleObserver {
final class DoubleObserverSdk extends AbstractInstrument implements DoubleObserver {
private final boolean monotonic;

DoubleObserverSdk(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@

import io.opentelemetry.metrics.LabelSet;
import io.opentelemetry.metrics.LongCounter;
import io.opentelemetry.metrics.LongCounter.BoundLongCounter;
import java.util.List;
import java.util.Map;

final class LongCounterSdk extends BaseInstrument implements LongCounter {
final class LongCounterSdk extends AbstractInstrument implements LongCounter {

private final boolean monotonic;

Expand Down Expand Up @@ -76,7 +75,7 @@ public int hashCode() {
return result;
}

private static final class Bound extends BaseBoundInstrument implements BoundLongCounter {
private static final class Bound extends AbstractBoundInstrument implements BoundLongCounter {

private final boolean monotonic;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@

import io.opentelemetry.metrics.LabelSet;
import io.opentelemetry.metrics.LongMeasure;
import io.opentelemetry.metrics.LongMeasure.BoundLongMeasure;
import java.util.List;
import java.util.Map;

final class LongMeasureSdk extends BaseInstrument implements LongMeasure {
final class LongMeasureSdk extends AbstractInstrument implements LongMeasure {

private final boolean absolute;

Expand Down Expand Up @@ -76,7 +75,7 @@ public int hashCode() {
return result;
}

private static final class Bound extends BaseBoundInstrument implements BoundLongMeasure {
private static final class Bound extends AbstractBoundInstrument implements BoundLongMeasure {

private final boolean absolute;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import java.util.List;
import java.util.Map;

final class LongObserverSdk extends BaseInstrument implements LongObserver {
final class LongObserverSdk extends AbstractInstrument implements LongObserver {
private final boolean monotonic;

LongObserverSdk(
Expand Down

0 comments on commit 7a832e6

Please sign in to comment.