52 lines
1.6 KiB
Java
52 lines
1.6 KiB
Java
package io.gitlab.jfronny.inceptum.launcher.model.inceptum;
|
|
|
|
import io.gitlab.jfronny.gson.compile.annotations.GSerializable;
|
|
import io.gitlab.jfronny.inceptum.common.GsonPreset;
|
|
|
|
import java.util.List;
|
|
import java.util.Objects;
|
|
|
|
@GSerializable
|
|
public class InstanceMeta {
|
|
public String version;
|
|
public String java;
|
|
public Long minMem;
|
|
public Long maxMem;
|
|
public Long lastLaunched;
|
|
public Arguments arguments;
|
|
|
|
@Override
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) return true;
|
|
if (obj == null || obj.getClass() != this.getClass()) return false;
|
|
var that = (InstanceMeta) obj;
|
|
return Objects.equals(this.version, that.version) &&
|
|
Objects.equals(this.java, that.java) &&
|
|
Objects.equals(this.minMem, that.minMem) &&
|
|
Objects.equals(this.maxMem, that.maxMem) &&
|
|
Objects.equals(this.lastLaunched, that.lastLaunched) &&
|
|
Objects.equals(this.arguments, that.arguments);
|
|
}
|
|
|
|
@Override
|
|
public int hashCode() {
|
|
return Objects.hash(version, java, minMem, maxMem, lastLaunched, arguments);
|
|
}
|
|
|
|
|
|
@GSerializable(configure = GsonPreset.Config.class)
|
|
public record Arguments(List<String> jvm, List<String> client, List<String> server) {
|
|
public Arguments withJvm(List<String> jvm) {
|
|
return new Arguments(jvm, client, server);
|
|
}
|
|
|
|
public Arguments withClient(List<String> client) {
|
|
return new Arguments(jvm, client, server);
|
|
}
|
|
|
|
public Arguments withServer(List<String> server) {
|
|
return new Arguments(jvm, client, server);
|
|
}
|
|
}
|
|
}
|