All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kaltura.client.utils.request.ExecutedRequest Maven / Gradle / Ivy

Go to download

KalturaOttApiClient is a library of Java classes that can be used to interact with the Kaltura OTT REST API. More information about the REST API can be found at https://ott.developer.kaltura.com/ Many of the Java classes in this library are auto-generated from a schema that defines the objects that are used to interact with the API.

There is a newer version: 5.1.2.17630
Show newest version
package com.kaltura.client.utils.request;

import com.kaltura.client.utils.ErrorElement;
import com.kaltura.client.utils.response.base.ResponseElement;

public class ExecutedRequest implements ResponseElement {

    String requestId;
    int code = -1;
    String response = null;
    boolean isSuccess = false;
    ErrorElement error = null;

    public ExecutedRequest requestId(String id) {
        this.requestId = id;
        return this;
    }

    public ExecutedRequest code(int code) {
        this.code = code;
        return this;
    }

    public ExecutedRequest response(String response) {
        this.response = response;
        return this;
    }

    public ExecutedRequest success(boolean success) {
        this.isSuccess = success;
        return this;
    }

    public ExecutedRequest error(ErrorElement error) {
        this.error = error;
        this.code = error.getCode();
        this.response = error.getMessage();
        return this;
    }

    public ExecutedRequest error(Exception exception) {
        return error(ErrorElement.fromException(exception));
    }

    @Override
    public int getCode() {
        return code;
    }

    @Override
    public String getResponse() {
        return response;
    }

    @Override
    public ErrorElement getError() {
        return error;
    }

    @Override
    public boolean isSuccess() {
        return isSuccess;
    }

    @Override
    public String getRequestId() {
        return requestId;
    }

}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy