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.binding.pioneeravr.internal.protocol.avr;
15 import org.openhab.binding.pioneeravr.internal.protocol.Response.ResponseType;
18 * Represent a response of the AVR.
20 * @author Antoine Besnard - Initial contribution
22 public interface AvrResponse {
25 * Represent the type of a response.
27 public interface AvrResponseType {
30 * Return the prefix of the command of this type.
35 public String getResponsePrefix(int zone);
38 * Return true if the responses of this type has to have a parameter.
42 public boolean hasParameter();
45 * Return the parameter pattern (RegEx) of the response.
49 public String getParameterPattern();
52 * Return the zone number if the responseData matches a zone of this responseType.
54 * If any zone matches, return null.
59 public Integer match(String responseData);
62 * Return the parameter value of the given responseData.
67 public String parseParameter(String responseData);
71 * Return the response type of this response
75 public ResponseType getResponseType();
78 * Return the parameter of this response or null if the resposne has no parameter.
82 public String getParameterValue();
85 * Return true if this response has a parameter.
89 public boolean hasParameter();
92 * Return the zone number which is concerned by this response.
96 public Integer getZone();