2023-04-20 10:11:12 +02:00
|
|
|
package it.cavallium.datagen.plugin;
|
2022-02-20 02:56:51 +01:00
|
|
|
|
2023-01-19 01:36:57 +01:00
|
|
|
import it.unimi.dsi.fastutil.objects.Object2IntMap;
|
|
|
|
import it.unimi.dsi.fastutil.objects.Object2ObjectMap;
|
2022-02-20 02:56:51 +01:00
|
|
|
import java.util.List;
|
2022-07-19 02:10:14 +02:00
|
|
|
import java.util.Objects;
|
2022-02-20 02:56:51 +01:00
|
|
|
|
|
|
|
public class VersionConfiguration {
|
|
|
|
|
2023-01-18 01:48:54 +01:00
|
|
|
public String previousVersion;
|
2022-02-20 02:56:51 +01:00
|
|
|
public DetailsConfiguration details;
|
|
|
|
public List<VersionTransformation> transformations;
|
2023-01-19 01:36:57 +01:00
|
|
|
/**
|
|
|
|
* <pre>
|
|
|
|
* Type 1: v1
|
|
|
|
* Type 2: v4
|
|
|
|
* Type 3: v2
|
|
|
|
* ...
|
|
|
|
* </pre>
|
|
|
|
*/
|
|
|
|
public Object2IntMap<String> typeVersions;
|
|
|
|
/**
|
|
|
|
* <pre>
|
|
|
|
* - Type 1
|
|
|
|
* |_Dependent type 1
|
|
|
|
* |_Dependent type 2
|
|
|
|
* |_Dependent type ...
|
|
|
|
*
|
|
|
|
* - Type 2
|
|
|
|
* |_Dependent type 1
|
|
|
|
* |_Dependent type 2
|
|
|
|
* |_Dependent type ...
|
|
|
|
* </pre>
|
|
|
|
*/
|
|
|
|
public Object2ObjectMap<String, List<String>> dependentTypes;
|
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;
|
|
|
|
}
|
|
|
|
VersionConfiguration that = (VersionConfiguration) o;
|
2023-01-18 01:48:54 +01:00
|
|
|
return Objects.equals(previousVersion, that.previousVersion) && Objects.equals(details, that.details)
|
|
|
|
&& Objects.equals(transformations, that.transformations);
|
2022-07-19 02:10:14 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
|
|
public int hashCode() {
|
2022-07-19 02:45:20 +02:00
|
|
|
int hash = 0;
|
2023-01-18 01:48:54 +01:00
|
|
|
hash += ConfigUtils.hashCode(previousVersion);
|
2022-07-19 02:45:20 +02:00
|
|
|
hash += ConfigUtils.hashCode(details);
|
|
|
|
hash += ConfigUtils.hashCode(transformations);
|
|
|
|
return hash;
|
2022-07-19 02:10:14 +02:00
|
|
|
}
|
2022-02-20 02:56:51 +01:00
|
|
|
}
|