Skip to content

Commit

Permalink
refactor(core): Add type bounds to AtomicOperation classes (#4817)
Browse files Browse the repository at this point in the history
These interfaces use raw types, which forces all implementations to
do the same as well (as you can't override a raw type with a
parametrized type).

I've added a few type bounds so that implementations can avoid using
raw types; this should in no way affect clients that are still using
raw types (as evidenced by the fact that I'm not changing any of the
implementations here).

Obviously Map<String, Object> is not great as a parameter type, but
that's what the Map actually is, and it's better than a raw Map.

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
ezimanyi and mergify[bot] committed Aug 19, 2020
1 parent b17672e commit 7f1c0e4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Expand Up @@ -27,5 +27,5 @@ public static String getValidatorName(String description) {
return description + "Validator";
}

public abstract void validate(List priorDescriptions, T description, ValidationErrors errors);
public abstract void validate(List<T> priorDescriptions, T description, ValidationErrors errors);
}
Expand Up @@ -37,7 +37,7 @@ public interface AtomicOperation<R> {
* @param priorOutputs
* @return parameterized type
*/
R operate(List priorOutputs);
R operate(List<R> priorOutputs);

default Collection<OperationEvent> getEvents() {
return Collections.emptyList();
Expand Down
Expand Up @@ -34,7 +34,7 @@ public interface AtomicOperationConverter extends VersionedCloudProviderOperatio
* @return atomic operation
*/
@Nullable
AtomicOperation convertOperation(Map input);
AtomicOperation convertOperation(Map<String, Object> input);

/**
* This method takes a Map input and creates a description object, that will often be used by an
Expand All @@ -43,5 +43,5 @@ public interface AtomicOperationConverter extends VersionedCloudProviderOperatio
* @param input
* @return instance of an operation description object
*/
Object convertDescription(Map input);
Object convertDescription(Map<String, Object> input);
}

0 comments on commit 7f1c0e4

Please sign in to comment.