Skip to content

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

@AlexRoig

Description

@AlexRoig

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();
    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions