refactor: WizardDisplayer

This commit is contained in:
huanghongxun
2020-06-26 21:29:47 +08:00
parent bd18355a1a
commit dc03f28d56
10 changed files with 73 additions and 223 deletions

View File

@@ -17,8 +17,10 @@
*/
package org.jackhuang.hmcl.download.game;
import com.google.gson.JsonParseException;
import com.google.gson.annotations.SerializedName;
import org.jackhuang.hmcl.util.Immutable;
import org.jackhuang.hmcl.util.gson.Validation;
import java.util.Collections;
import java.util.List;
@@ -28,7 +30,7 @@ import java.util.List;
* @author huangyuhui
*/
@Immutable
public final class GameRemoteVersions {
public final class GameRemoteVersions implements Validation {
@SerializedName("versions")
private final List<GameRemoteVersionInfo> versions;
@@ -57,4 +59,9 @@ public final class GameRemoteVersions {
return versions;
}
@Override
public void validate() throws JsonParseException {
if (versions == null)
throw new JsonParseException("GameRemoteVersions.versions cannot be null");
}
}