2023-04-20 10:11:12 +02:00
|
|
|
package it.cavallium.datagen.plugin;
|
2022-02-20 02:56:51 +01:00
|
|
|
|
2022-07-19 02:10:14 +02:00
|
|
|
import java.util.Objects;
|
|
|
|
|
2022-02-20 02:56:51 +01:00
|
|
|
public class UpgradeDataConfiguration implements TransformationConfiguration {
|
|
|
|
|
|
|
|
public String transformClass;
|
|
|
|
public String from;
|
2023-01-18 01:48:54 +01:00
|
|
|
public String type;
|
2022-02-20 02:56:51 +01:00
|
|
|
public String upgrader;
|
2023-11-09 01:56:09 +01:00
|
|
|
public String upgraderInstance;
|
2022-02-20 02:56:51 +01:00
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getTransformClass() {
|
|
|
|
return transformClass;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public String getTransformName() {
|
|
|
|
return "upgrade-data";
|
|
|
|
}
|
2022-07-19 02:10:14 +02:00
|
|
|
|
2023-11-09 01:56:09 +01:00
|
|
|
public JInterfaceLocation getUpgraderLocation() {
|
|
|
|
return JInterfaceLocation.parse(upgrader, upgraderInstance);
|
|
|
|
}
|
|
|
|
|
2022-07-19 02:10:14 +02:00
|
|
|
@Override
|
|
|
|
public boolean equals(Object o) {
|
|
|
|
if (this == o) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
if (o == null || getClass() != o.getClass()) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
UpgradeDataConfiguration that = (UpgradeDataConfiguration) o;
|
2023-01-18 01:48:54 +01:00
|
|
|
return Objects.equals(transformClass, that.transformClass) && Objects.equals(from, that.from)
|
2023-11-09 01:56:09 +01:00
|
|
|
&& Objects.equals(type, that.type) && Objects.equals(upgrader, that.upgrader)
|
|
|
|
&& Objects.equals(upgraderInstance, that.upgraderInstance);
|
2022-07-19 02:10:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
2022-07-19 02:45:20 +02:00
|
|
|
int hash = 0;
|
|
|
|
hash += ConfigUtils.hashCode(transformClass);
|
|
|
|
hash += ConfigUtils.hashCode(from);
|
2023-01-18 01:48:54 +01:00
|
|
|
hash += ConfigUtils.hashCode(type);
|
2022-07-19 02:45:20 +02:00
|
|
|
hash += ConfigUtils.hashCode(upgrader);
|
2023-11-09 01:56:09 +01:00
|
|
|
hash += ConfigUtils.hashCode(upgraderInstance);
|
2022-07-19 02:45:20 +02:00
|
|
|
return hash;
|
2022-07-19 02:10:14 +02:00
|
|
|
}
|
2023-01-18 01:48:54 +01:00
|
|
|
|
2023-01-21 21:00:40 +01:00
|
|
|
public UpgradeDataConfiguration copy() {
|
2023-01-18 01:48:54 +01:00
|
|
|
var c = new UpgradeDataConfiguration();
|
|
|
|
if (this.transformClass != null) c.transformClass = this.transformClass;
|
|
|
|
if (this.from != null) c.from = this.from;
|
|
|
|
if (this.type != null) c.type = this.type;
|
|
|
|
if (this.upgrader != null) c.upgrader = this.upgrader;
|
2023-11-09 01:56:09 +01:00
|
|
|
if (this.upgraderInstance != null) c.upgraderInstance = this.upgraderInstance;
|
2023-01-18 01:48:54 +01:00
|
|
|
return c;
|
|
|
|
}
|
2022-02-20 02:56:51 +01:00
|
|
|
}
|