Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Printer's name is not parsed from the JSON response #1

Open
AlexRoig opened this issue Apr 10, 2016 · 0 comments
Open

Printer's name is not parsed from the JSON response #1

AlexRoig opened this issue Apr 10, 2016 · 0 comments

Comments

@AlexRoig
Copy link

The printer's name is not parsed on the JSON response. Attaching suggested change on Printer.java:

public Printer(final JsonObject response) {
        if (!response.get("id").isJsonNull()) {
            id = response.get("id").getAsInt();
        }
        if (!response.get("computer").isJsonNull()) {
            computer = new Computer(response.get("computer").getAsJsonObject());
        }
        if (!response.get("description").isJsonNull()) {
            description = response.get("description").getAsString();
        }
        if (!response.get("name").isJsonNull()) {
            name = response.get("name").getAsString();
        }
        if (!response.get("capabilities").isJsonNull()) {
            capabilities = new Capabilities(response.get("capabilities").getAsJsonObject());
        }
        if (!response.get("default").isJsonNull()) {
            defaults = response.get("default").getAsString();
        }
        if (!response.get("createTimestamp").isJsonNull()) {
            createTimestamp = response.get("createTimestamp").getAsString();
        }
        if (!response.get("state").isJsonNull()) {
            state = response.get("state").getAsString();
        }
        json = response.toString();
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant