Skip to content

Commit

Permalink
Rename InternalSchemaSwaps.Value to InternalSchemaSwaps.InternalSchem…
Browse files Browse the repository at this point in the history
…aSwap. fabric8io#4350
  • Loading branch information
xRodney committed Aug 26, 2022
1 parent a1dd23a commit 090c575
Showing 1 changed file with 6 additions and 6 deletions.
Expand Up @@ -25,19 +25,19 @@
import java.util.stream.Stream;

public class InternalSchemaSwaps {
private final Map<Key, Value> swaps = new HashMap<>();
private final Map<Key, InternalSchemaSwap> swaps = new HashMap<>();

public void registerSwap(ClassRef definitionType, ClassRef originalType, String fieldName, ClassRef targetType) {
Value value = new Value(definitionType, originalType, fieldName, targetType);
InternalSchemaSwap value = new InternalSchemaSwap(definitionType, originalType, fieldName, targetType);
swaps.put(new Key(originalType, fieldName), value);
}

public Stream<Value> getUnusedSwaps() {
public Stream<InternalSchemaSwap> getUnusedSwaps() {
return swaps.values().stream().filter(value -> !value.used);
}

public Optional<ClassRef> lookupAndMark(ClassRef originalType, String name) {
Value value = swaps.get(new Key(originalType, name));
InternalSchemaSwap value = swaps.get(new Key(originalType, name));
if (value != null) {
value.markUsed();
return Optional.of(value.getTargetType());
Expand Down Expand Up @@ -89,14 +89,14 @@ public String toString() {
}
}

public static class Value {
public static class InternalSchemaSwap {
private final ClassRef originalType;
private final String fieldName;
private final ClassRef targetType;
private boolean used;
private final ClassRef definitionType;

public Value(ClassRef definitionType, ClassRef originalType, String fieldName, ClassRef targetType) {
public InternalSchemaSwap(ClassRef definitionType, ClassRef originalType, String fieldName, ClassRef targetType) {
this.definitionType = definitionType;
this.originalType = originalType;
this.fieldName = fieldName;
Expand Down

0 comments on commit 090c575

Please sign in to comment.