]> git.basschouten.com Git - openhab-addons.git/blob
41a285367bdde897a5c452d5a52687ad9c0e22d5
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2020 Contributors to the openHAB project
3  *
4  * See the NOTICE file(s) distributed with this work for additional
5  * information.
6  *
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
10  *
11  * SPDX-License-Identifier: EPL-2.0
12  */
13 package org.openhab.binding.elerotransmitterstick.internal.stick;
14
15 import java.util.Arrays;
16
17 /**
18  * @author Volker Bier - Initial contribution
19  */
20 public class Response {
21     private ResponseStatus status;
22     private int[] channels;
23
24     public Response(ResponseStatus status, int[] channels) {
25         this.status = status;
26         this.channels = channels;
27     }
28
29     public Response(int[] channels) {
30         this.channels = channels;
31     }
32
33     public boolean isMoving() {
34         return status == ResponseStatus.MOVING_DOWN || status == ResponseStatus.MOVING_UP;
35     }
36
37     public int[] getChannelIds() {
38         return channels;
39     }
40
41     public boolean hasStatus() {
42         return status != null;
43     }
44
45     public ResponseStatus getStatus() {
46         return status;
47     }
48
49     @Override
50     public String toString() {
51         return status + " for channels " + Arrays.toString(channels);
52     }
53 }