Skip to content

Commit

Permalink
Make classes implement JApiHasChangeStatus if they already do
Browse files Browse the repository at this point in the history
guillermocalvo committed Jan 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 87ad17f commit 29c722d
Showing 6 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion japicmp/src/main/java/japicmp/model/JApiAttribute.java
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;

public class JApiAttribute<T> {
public class JApiAttribute<T> implements JApiHasChangeStatus {
private final Optional<T> oldAttribute;
private final Optional<T> newAttribute;
private final JApiChangeStatus changeStatus;
@@ -27,6 +27,7 @@ public Optional<T> getNewAttribute() {
return newAttribute;
}

@Override
@XmlAttribute(name = "changeStatus")
public JApiChangeStatus getChangeStatus() {
return changeStatus;
3 changes: 2 additions & 1 deletion japicmp/src/main/java/japicmp/model/JApiClassType.java
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;

public class JApiClassType {
public class JApiClassType implements JApiHasChangeStatus {
private final Optional<ClassType> oldTypeOptional;
private final Optional<ClassType> newTypeOptional;
private final JApiChangeStatus changeStatus;
@@ -31,6 +31,7 @@ public String getNewType() {
return OptionalHelper.optionalToString(newTypeOptional);
}

@Override
@XmlAttribute
public JApiChangeStatus getChangeStatus() {
return changeStatus;
3 changes: 2 additions & 1 deletion japicmp/src/main/java/japicmp/model/JApiModifier.java
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@

import javax.xml.bind.annotation.XmlAttribute;

public class JApiModifier<T> {
public class JApiModifier<T> implements JApiHasChangeStatus {
private final Optional<T> oldModifier;
private final Optional<T> newModifier;
private final JApiChangeStatus changeStatus;
@@ -24,6 +24,7 @@ public Optional<T> getNewModifier() {
return newModifier;
}

@Override
@XmlAttribute(name = "changeStatus")
public JApiChangeStatus getChangeStatus() {
return changeStatus;
3 changes: 2 additions & 1 deletion japicmp/src/main/java/japicmp/model/JApiReturnType.java
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@
import java.util.ArrayList;
import java.util.List;

public class JApiReturnType implements JApiHasGenericTypes, JApiCompatibility {
public class JApiReturnType implements JApiHasGenericTypes, JApiHasChangeStatus, JApiCompatibility {
private final Optional<String> oldReturnTypeOptional;
private final Optional<String> newReturnTypeOptional;
private final JApiChangeStatus changeStatus;
@@ -23,6 +23,7 @@ public JApiReturnType(JApiChangeStatus changeStatus, Optional<String> oldReturnT
this.newReturnTypeOptional = newReturnTypeOptional;
}

@Override
@XmlAttribute(name = "changeStatus")
public JApiChangeStatus getChangeStatus() {
return changeStatus;
3 changes: 2 additions & 1 deletion japicmp/src/main/java/japicmp/model/JApiType.java
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlTransient;

public class JApiType {
public class JApiType implements JApiHasChangeStatus {
private final Optional<String> oldTypeOptional;
private final Optional<String> newTypeOptional;
private final JApiChangeStatus changeStatus;
@@ -27,6 +27,7 @@ public Optional<String> getNewTypeOptional() {
return newTypeOptional;
}

@Override
@XmlAttribute(name = "changeStatus")
public JApiChangeStatus getChangeStatus() {
return changeStatus;
Original file line number Diff line number Diff line change
@@ -2,11 +2,12 @@

import japicmp.util.Optional;
import japicmp.model.JApiChangeStatus;
import japicmp.model.JApiHasChangeStatus;
import japicmp.util.OptionalHelper;

import javax.xml.bind.annotation.XmlAttribute;

public class JpaName {
public class JpaName implements JApiHasChangeStatus {
private final Optional<String> newName;
private final Optional<String> oldName;
private final JApiChangeStatus changeStatus;
@@ -17,6 +18,7 @@ public JpaName(Optional<String> oldName, Optional<String> newName, JApiChangeSta
this.changeStatus = changeStatus;
}

@Override
@XmlAttribute(name = "changeStatus")
public JApiChangeStatus getChangeStatus() {
return changeStatus;

0 comments on commit 29c722d

Please sign in to comment.