33 lines
1.2 KiB
Java
33 lines
1.2 KiB
Java
package com.ruoyi.shadow.evidence;
|
|
|
|
import java.util.Objects;
|
|
|
|
public final class ShadowDifference {
|
|
private final ShadowDifferenceCategory category;
|
|
private final String reasonCode;
|
|
private final String expectedJson;
|
|
private final String actualJson;
|
|
|
|
public ShadowDifference(ShadowDifferenceCategory category,
|
|
String reasonCode,
|
|
String expectedJson,
|
|
String actualJson) {
|
|
this.category = Objects.requireNonNull(category, "category");
|
|
this.reasonCode = required(reasonCode, "reasonCode");
|
|
this.expectedJson = expectedJson;
|
|
this.actualJson = actualJson;
|
|
}
|
|
|
|
public ShadowDifferenceCategory getCategory() { return category; }
|
|
public String getReasonCode() { return reasonCode; }
|
|
public String getExpectedJson() { return expectedJson; }
|
|
public String getActualJson() { return actualJson; }
|
|
|
|
private static String required(String value, String name) {
|
|
if (value == null || value.trim().isEmpty()) {
|
|
throw new IllegalArgumentException(name + " must not be blank");
|
|
}
|
|
return value.trim();
|
|
}
|
|
}
|