2 * Copyright (c) 2010-2020 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 package org.openhab.io.transport.modbus;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.io.transport.modbus.endpoint.ModbusSlaveEndpoint;
19 * Common base interface for read and write tasks.
21 * @author Sami Salonen - Initial contribution
23 * @param <R> request type
24 * @param <C> callback type
27 public interface TaskWithEndpoint<R, C extends ModbusResultCallback, F extends ModbusFailureCallback<R>> {
29 * Gets endpoint associated with this task
33 ModbusSlaveEndpoint getEndpoint();
36 * Gets request associated with this task
43 * Gets the result callback associated with this task, will be called with response
47 C getResultCallback();
50 * Gets the failure callback associated with this task, will be called in case of an error
54 F getFailureCallback();