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

org.esbtools.eventhandler.lightblue.client.SuccessLightblueResponse Maven / Gradle / Ivy

There is a newer version: 0.1.15
Show newest version
package org.esbtools.eventhandler.lightblue.client;

import com.redhat.lightblue.client.response.LightblueDataResponse;
import com.redhat.lightblue.client.response.LightblueErrorResponse;

import java.util.NoSuchElementException;

class SuccessLightblueResponse implements LightblueResponse {
    private final LightblueDataResponse response;

    SuccessLightblueResponse(LightblueDataResponse response) {
        this.response = response;
    }

    @Override
    public LightblueDataResponse getSuccess() {
        return response;
    }

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

    @Override
    public LightblueErrorResponse getFailure() {
        throw new NoSuchElementException("There is no error response because the request was " +
                "successful.");
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy