APISonar


org.openhab.binding.digitalstrom.internal.lib.serverconnection.simpledsrequestbuilder.constants.FunctionKeys.TIME

> org > openhab > binding > digitalstrom > internal > lib > serverconnection > simpledsrequestbuilder > constants > FunctionKeys > TIME
org APIs openhab APIs binding APIs digitalstrom APIs internal APIs lib APIs serverconnection APIs simpledsrequestbuilder APIs constants APIs FunctionKeys APIs TIME APIs

Example 1
public int getTime(String token) {
        String response = transport.execute(SimpleRequestBuilder.buildNewJsonRequest(ClassKeys.SYSTEM)
                .addFunction(FunctionKeys.TIME).addParameter(ParameterKeys.TOKEN, token).buildRequestString());
        JsonObject responseObj = JSONResponseHandler.toJsonObject(response);

        if (JSONResponseHandler.checkResponse(responseObj)) {
            JsonObject obj = JSONResponseHandler.getResultJsonObject(responseObj);

            if (checkBlankField(obj, JSONApiResponseKeysEnum.TIME.getKey())) {
                return obj.get(JSONApiResponseKeysEnum.TIME.getKey()).getAsInt();
            }
        }
        return -1;
    }