mirror of
https://github.com/google/nomulus
synced 2026-01-10 07:57:58 +00:00
Clean up some code quality issues
This removes some qualifiers that aren't necessary (e.g. public/abstract on interfaces, private on enum constructors, final on private methods, static on nested interfaces/enums), uses Java 8 lambdas and features where that's an improvement ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=177182945
This commit is contained in:
@@ -17,6 +17,7 @@ package google.registry.monitoring.metrics.contrib;
|
||||
import static com.google.common.truth.Truth.assertAbout;
|
||||
|
||||
import com.google.common.truth.FailureMetadata;
|
||||
import com.google.common.truth.Subject;
|
||||
import google.registry.monitoring.metrics.Metric;
|
||||
import google.registry.monitoring.metrics.MetricPoint;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -43,8 +44,11 @@ import javax.annotation.Nullable;
|
||||
*/
|
||||
public final class LongMetricSubject extends AbstractMetricSubject<Long, LongMetricSubject> {
|
||||
|
||||
/** {@link Subject.Factory} for assertions about {@link Metric<Long>} objects. */
|
||||
/** Static assertThat({@link Metric<Long>}) shortcut method. */
|
||||
/**
|
||||
* Static assertThat({@link Metric<Long>}) shortcut method.
|
||||
*
|
||||
* @see Subject.Factory for assertions about {@link Metric<Long>} objects.
|
||||
*/
|
||||
public static LongMetricSubject assertThat(@Nullable Metric<Long> metric) {
|
||||
return assertAbout(LongMetricSubject::new).that(metric);
|
||||
}
|
||||
|
||||
@@ -110,9 +110,7 @@ public abstract class EppMetric implements BigQueryMetric {
|
||||
*/
|
||||
private static <T> void addOptional(
|
||||
String key, Optional<T> value, ImmutableMap.Builder<String, String> map) {
|
||||
if (value.isPresent()) {
|
||||
map.put(key, value.get().toString());
|
||||
}
|
||||
value.ifPresent(t -> map.put(key, t.toString()));
|
||||
}
|
||||
|
||||
/** Create an {@link EppMetric.Builder}. */
|
||||
|
||||
Reference in New Issue
Block a user