refactor: WizardDisplayer
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user