package com.mojang.realmsclient.dto;

import org.apache.logging.log4j.LogManager;
import com.google.gson.JsonObject;
import com.mojang.realmsclient.util.JsonUtils;
import com.google.gson.JsonParser;
import org.apache.logging.log4j.Logger;

public class RealmsServerAddress extends ValueObject {
    private static final Logger LOGGER;
    public String address;
    public String resourcePackUrl;
    public String resourcePackHash;
    
    public static RealmsServerAddress parse(final String string) {
        final JsonParser jsonParser2 = new JsonParser();
        final RealmsServerAddress realmsServerAddress3 = new RealmsServerAddress();
        try {
            final JsonObject jsonObject4 = jsonParser2.parse(string).getAsJsonObject();
            realmsServerAddress3.address = JsonUtils.getStringOr("address", jsonObject4, null);
            realmsServerAddress3.resourcePackUrl = JsonUtils.getStringOr("resourcePackUrl", jsonObject4, null);
            realmsServerAddress3.resourcePackHash = JsonUtils.getStringOr("resourcePackHash", jsonObject4, null);
        }
        catch (Exception exception4) {
            RealmsServerAddress.LOGGER.error("Could not parse RealmsServerAddress: " + exception4.getMessage());
        }
        return realmsServerAddress3;
    }
    
    static {
        LOGGER = LogManager.getLogger();
    }
}
