2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
7 * This program and the accompanying materials are made available under the
8 * terms of the Eclipse Public License 2.0 which is available at
9 * http://www.eclipse.org/legal/epl-2.0
11 * SPDX-License-Identifier: EPL-2.0
13 /* This file is based on:
18 * Copyright (c) 2014 LG Electronics.
19 * Created by Hyun Kook Khang on 19 Jan 2014
21 * Licensed under the Apache License, Version 2.0 (the "License");
22 * you may not use this file except in compliance with the License.
23 * You may obtain a copy of the License at
25 * http://www.apache.org/licenses/LICENSE-2.0
27 * Unless required by applicable law or agreed to in writing, software
28 * distributed under the License is distributed on an "AS IS" BASIS,
29 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
30 * See the License for the specific language governing permissions and
31 * limitations under the License.
34 package org.openhab.binding.lgwebos.internal.handler.core;
36 import org.eclipse.jdt.annotation.NonNullByDefault;
39 * Generic asynchronous operation response success handler block. If there is any response data to be processed, it will
40 * be provided via the responseObject parameter.
42 * @author Hyun Kook Khang - Connect SDK initial contribution
43 * @author Sebastian Prehn - Adoption for openHAB
46 public interface ResponseListener<T> {
49 * Returns the success of the call of type T.
50 * Contains the output data as a generic object reference.
51 * This value may be any of a number of types as defined by T in subclasses of ResponseListener.
53 * @param responseObject Response object, can be any number of object types, depending on the
54 * protocol/capability/etc
56 void onSuccess(T responseObject);
59 * Method to return the error message that was generated.
62 void onError(String message);