All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.quarkus.smallrye.metrics.runtime.GetCountOnlyCounter Maven / Gradle / Ivy

There is a newer version: 3.17.0
Show newest version
package io.quarkus.smallrye.metrics.runtime;

import org.eclipse.microprofile.metrics.Counter;

/**
 * A helper abstract class for implementing counters which only need a getCount method.
 * Other methods throw an exception.
 */
public abstract class GetCountOnlyCounter implements Counter {

    private static final String MUST_NOT_BE_CALLED = "Must not be called";

    @Override
    public void inc() {
        throw new IllegalStateException(MUST_NOT_BE_CALLED);
    }

    @Override
    public void inc(long n) {
        throw new IllegalStateException(MUST_NOT_BE_CALLED);
    }

    @Override
    public abstract long getCount();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy