data-generator/datagen-plugin/src/main/java/it/cavallium/datagen/plugin/UpgradeDataConfiguration.java

54 lines
1.3 KiB
Java
Raw Normal View History

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;
@Override
public String getTransformClass() {
return transformClass;
}
@Override
public String getTransformName() {
return "upgrade-data";
}
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)
&& Objects.equals(type, that.type) && Objects.equals(upgrader, that.upgrader);
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);
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;
return c;
}
2022-02-20 02:56:51 +01:00
}