Skip to content

Commit

Permalink
Ensure interfaces follow coding standards (OpenGamma#1753)
Browse files Browse the repository at this point in the history
  • Loading branch information
jodastephen committed Jun 27, 2018
1 parent c390964 commit 7bf106a
Show file tree
Hide file tree
Showing 54 changed files with 82 additions and 83 deletions.
25 changes: 12 additions & 13 deletions modules/calc/src/main/java/com/opengamma/strata/calc/Measure.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,18 @@ public static Measure of(String uniqueName) {
return extendedEnum().lookup(uniqueName);
}

/**
* Gets the extended enum helper.
* <p>
* This helper allows instances of the measure to be looked up.
* It also provides the complete set of available instances.
*
* @return the extended enum helper
*/
public static ExtendedEnum<Measure> extendedEnum() {
return MeasureHelper.ENUM_LOOKUP;
}

//-------------------------------------------------------------------------
/**
* Gets the name that uniquely identifies this measure.
Expand All @@ -58,17 +70,4 @@ public static Measure of(String uniqueName) {
*/
public abstract boolean isCurrencyConvertible();

//-------------------------------------------------------------------------
/**
* Gets the extended enum helper.
* <p>
* This helper allows instances of the measure to be looked up.
* It also provides the complete set of available instances.
*
* @return the extended enum helper
*/
static ExtendedEnum<Measure> extendedEnum() {
return MeasureHelper.ENUM_LOOKUP;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static FxRateLookup ofMatrix(FxMatrixId matrixId) {

//-------------------------------------------------------------------------
@Override
default Class<? extends CalculationParameter> queryType() {
public default Class<? extends CalculationParameter> queryType() {
return FxRateLookup.class;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public interface CheckedBiConsumer<T, U> {
* @param u the second input argument
* @throws Throwable if an error occurs
*/
public void accept(T t, U u) throws Throwable;
public abstract void accept(T t, U u) throws Throwable;

}
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ public interface CheckedBiFunction<T, U, R> {
* @return the function result
* @throws Throwable if an error occurs
*/
public R apply(T t, U u) throws Throwable;
public abstract R apply(T t, U u) throws Throwable;

}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ public interface CheckedBiPredicate<T, U> {
* @return true if the input arguments match the predicate
* @throws Throwable if an error occurs
*/
public boolean test(T t, U u) throws Throwable;
public abstract boolean test(T t, U u) throws Throwable;

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public interface CheckedConsumer<T> {
* @param t the input argument
* @throws Throwable if an error occurs
*/
public void accept(T t) throws Throwable;
public abstract void accept(T t) throws Throwable;

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public interface CheckedFunction<T, R> {
* @return the function result
* @throws Throwable if an error occurs
*/
public R apply(T t) throws Throwable;
public abstract R apply(T t) throws Throwable;

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ public interface CheckedPredicate<T> {
* @return true if the input argument matches the predicate
* @throws Throwable if an error occurs
*/
public boolean test(T t) throws Throwable;
public abstract boolean test(T t) throws Throwable;

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public interface CheckedRunnable {
*
* @throws Throwable if an error occurs
*/
public void run() throws Throwable;
public abstract void run() throws Throwable;

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ public interface CheckedSupplier<R> {
* @return a result
* @throws Throwable if an error occurs
*/
public R get() throws Throwable;
public abstract R get() throws Throwable;

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
* @param <T> the type of the object parameter
*/
@FunctionalInterface
public interface CheckedUnaryOperator<T> extends CheckedFunction<T, T> {
public abstract interface CheckedUnaryOperator<T> extends CheckedFunction<T, T> {

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public interface DoubleTernaryOperator {
* @param c the third argument
* @return the result of the function
*/
double applyAsDouble(double a, double b, double c);
public abstract double applyAsDouble(double a, double b, double c);

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public interface IntDoubleConsumer {
* @param intValue the first argument
* @param doubleValue the second argument
*/
void accept(int intValue, double doubleValue);
public abstract void accept(int intValue, double doubleValue);

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public interface IntDoublePredicate {
* @param doubleValue the second argument
* @return true if the arguments match the predicate
*/
boolean test(int intValue, double doubleValue);
public abstract boolean test(int intValue, double doubleValue);

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public interface IntDoubleToDoubleFunction {
* @param doubleValue the second argument
* @return the result
*/
double applyAsDouble(int intValue, double doubleValue);
public abstract double applyAsDouble(int intValue, double doubleValue);

}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public interface IntIntConsumer {
* @param intValue1 the first argument
* @param intValue2 the second argument
*/
void accept(int intValue1, int intValue2);
public abstract void accept(int intValue1, int intValue2);

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public interface IntIntDoubleConsumer {
* @param intValue2 the second argument
* @param doubleValue the third argument
*/
void accept(int intValue1, int intValue2, double doubleValue);
public abstract void accept(int intValue1, int intValue2, double doubleValue);

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public interface IntIntDoublePredicate {
* @param doubleValue the third argument
* @return true if the arguments match the predicate
*/
boolean test(int intValue1, int intValue2, double doubleValue);
public abstract boolean test(int intValue1, int intValue2, double doubleValue);

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public interface IntIntDoubleToDoubleFunction {
* @param doubleValue the third argument
* @return the result
*/
double applyAsDouble(int intValue1, int intValue2, double doubleValue);
public abstract double applyAsDouble(int intValue1, int intValue2, double doubleValue);

}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ public interface IntIntToDoubleFunction {
* @param intValue2 the second argument
* @return the result
*/
double applyAsDouble(int intValue1, int intValue2);
public abstract double applyAsDouble(int intValue1, int intValue2);

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ public interface IntTernaryOperator {
* @param c the third argument
* @return the result of the function
*/
int applyAsInt(int a, int b, int c);
public abstract int applyAsInt(int a, int b, int c);

}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface ObjDoubleFunction<T, R> {
* @param value the second argument
* @return the result of the function
*/
R apply(T obj, double value);
public abstract R apply(T obj, double value);

/**
* Returns a new function that composes this function and the specified function.
Expand All @@ -41,7 +41,7 @@ public interface ObjDoubleFunction<T, R> {
* @return the combined function, "this AND_THEN that"
* @throws NullPointerException if the other function is null
*/
default <V> ObjDoubleFunction<T, V> andThen(Function<? super R, ? extends V> other) {
public default <V> ObjDoubleFunction<T, V> andThen(Function<? super R, ? extends V> other) {
Objects.requireNonNull(other);
return (obj, value) -> other.apply(apply(obj, value));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface ObjDoublePredicate<T> {
* @param value the second argument
* @return true if the arguments match the predicate
*/
boolean test(T obj, double value);
public abstract boolean test(T obj, double value);

/**
* Returns a new predicate that returns true if both predicates return true.
Expand All @@ -37,7 +37,7 @@ public interface ObjDoublePredicate<T> {
* @return the combined predicate, "this AND that"
* @throws NullPointerException if the other predicate is null
*/
default ObjDoublePredicate<T> and(ObjDoublePredicate<? super T> other) {
public default ObjDoublePredicate<T> and(ObjDoublePredicate<? super T> other) {
Objects.requireNonNull(other);
return (obj, value) -> test(obj, value) && other.test(obj, value);
}
Expand All @@ -51,7 +51,7 @@ default ObjDoublePredicate<T> and(ObjDoublePredicate<? super T> other) {
* @return the combined predicate, "this OR that"
* @throws NullPointerException if the other predicate is null
*/
default ObjDoublePredicate<T> or(ObjDoublePredicate<? super T> other) {
public default ObjDoublePredicate<T> or(ObjDoublePredicate<? super T> other) {
Objects.requireNonNull(other);
return (obj, value) -> test(obj, value) || other.test(obj, value);
}
Expand All @@ -61,7 +61,7 @@ default ObjDoublePredicate<T> or(ObjDoublePredicate<? super T> other) {
*
* @return the predicate, "NOT this"
*/
default ObjDoublePredicate<T> negate() {
public default ObjDoublePredicate<T> negate() {
return (obj, value) -> !test(obj, value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface ObjIntFunction<T, R> {
* @param value the second argument
* @return the result of the function
*/
R apply(T obj, int value);
public abstract R apply(T obj, int value);

/**
* Returns a new function that composes this function and the specified function.
Expand All @@ -41,7 +41,7 @@ public interface ObjIntFunction<T, R> {
* @return the combined function, "this AND_THEN that"
* @throws NullPointerException if the other function is null
*/
default <V> ObjIntFunction<T, V> andThen(Function<? super R, ? extends V> other) {
public default <V> ObjIntFunction<T, V> andThen(Function<? super R, ? extends V> other) {
Objects.requireNonNull(other);
return (obj, value) -> other.apply(apply(obj, value));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface ObjIntPredicate<T> {
* @param value the second argument
* @return true if the arguments match the predicate
*/
boolean test(T obj, int value);
public abstract boolean test(T obj, int value);

/**
* Returns a new predicate that returns true if both predicates return true.
Expand All @@ -37,7 +37,7 @@ public interface ObjIntPredicate<T> {
* @return the combined predicate, "this AND that"
* @throws NullPointerException if the other predicate is null
*/
default ObjIntPredicate<T> and(ObjIntPredicate<? super T> other) {
public default ObjIntPredicate<T> and(ObjIntPredicate<? super T> other) {
Objects.requireNonNull(other);
return (obj, value) -> test(obj, value) && other.test(obj, value);
}
Expand All @@ -51,7 +51,7 @@ default ObjIntPredicate<T> and(ObjIntPredicate<? super T> other) {
* @return the combined predicate, "this OR that"
* @throws NullPointerException if the other predicate is null
*/
default ObjIntPredicate<T> or(ObjIntPredicate<? super T> other) {
public default ObjIntPredicate<T> or(ObjIntPredicate<? super T> other) {
Objects.requireNonNull(other);
return (obj, value) -> test(obj, value) || other.test(obj, value);
}
Expand All @@ -61,7 +61,7 @@ default ObjIntPredicate<T> or(ObjIntPredicate<? super T> other) {
*
* @return the predicate, "NOT this"
*/
default ObjIntPredicate<T> negate() {
public default ObjIntPredicate<T> negate() {
return (obj, value) -> !test(obj, value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public interface ObjLongFunction<T, R> {
* @param value the second argument
* @return the result of the function
*/
R apply(T obj, long value);
public abstract R apply(T obj, long value);

/**
* Returns a new function that composes this function and the specified function.
Expand All @@ -41,7 +41,7 @@ public interface ObjLongFunction<T, R> {
* @return the combined function, "this AND_THEN that"
* @throws NullPointerException if the other function is null
*/
default <V> ObjLongFunction<T, V> andThen(Function<? super R, ? extends V> other) {
public default <V> ObjLongFunction<T, V> andThen(Function<? super R, ? extends V> other) {
Objects.requireNonNull(other);
return (obj, value) -> other.apply(apply(obj, value));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public interface ObjLongPredicate<T> {
* @param value the second argument
* @return true if the arguments match the predicate
*/
boolean test(T obj, long value);
public abstract boolean test(T obj, long value);

/**
* Returns a new predicate that returns true if both predicates return true.
Expand All @@ -37,7 +37,7 @@ public interface ObjLongPredicate<T> {
* @return the combined predicate, "this AND that"
* @throws NullPointerException if the other predicate is null
*/
default ObjLongPredicate<T> and(ObjLongPredicate<? super T> other) {
public default ObjLongPredicate<T> and(ObjLongPredicate<? super T> other) {
Objects.requireNonNull(other);
return (obj, value) -> test(obj, value) && other.test(obj, value);
}
Expand All @@ -51,7 +51,7 @@ default ObjLongPredicate<T> and(ObjLongPredicate<? super T> other) {
* @return the combined predicate, "this OR that"
* @throws NullPointerException if the other predicate is null
*/
default ObjLongPredicate<T> or(ObjLongPredicate<? super T> other) {
public default ObjLongPredicate<T> or(ObjLongPredicate<? super T> other) {
Objects.requireNonNull(other);
return (obj, value) -> test(obj, value) || other.test(obj, value);
}
Expand All @@ -61,7 +61,7 @@ default ObjLongPredicate<T> or(ObjLongPredicate<? super T> other) {
*
* @return the predicate, "NOT this"
*/
default ObjLongPredicate<T> negate() {
public default ObjLongPredicate<T> negate() {
return (obj, value) -> !test(obj, value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,6 @@ public default boolean isScenarioValue() {
*
* @return a stream over the contents of the box
*/
public Stream<T> stream();
public abstract Stream<T> stream();

}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ public interface LegAmount extends FxConvertible<LegAmount> {
*
* @return the amount
*/
CurrencyAmount getAmount();
public abstract CurrencyAmount getAmount();

}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public default ParameterMetadata getParameterMetadata(int parameterIndex) {
public abstract Curve withParameter(int parameterIndex, double newValue);

@Override
default Curve withPerturbation(ParameterPerturbation perturbation) {
public default Curve withPerturbation(ParameterPerturbation perturbation) {
return (Curve) ParameterizedData.super.withPerturbation(perturbation);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ public default ParameterMetadata getParameterMetadata(int parameterIndex) {

//-------------------------------------------------------------------------
@Override
abstract NodalCurve withParameter(int parameterIndex, double newValue);
public abstract NodalCurve withParameter(int parameterIndex, double newValue);

@Override
default NodalCurve withPerturbation(ParameterPerturbation perturbation) {
public default NodalCurve withPerturbation(ParameterPerturbation perturbation) {
return (NodalCurve) Curve.super.withPerturbation(perturbation);
}

Expand Down
Loading

0 comments on commit 7bf106a

Please sign in to comment.