]> git.basschouten.com Git - openhab-addons.git/blob
b8c29a2dc2c1295af70d77662a6aa551fbc0b4a2
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2023 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.nuki.internal.dataexchange;
14
15 import java.time.Instant;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
19
20 /**
21  * The {@link NukiBaseResponse} class is the base class for API Responses.
22  *
23  * @author Markus Katter - Initial contribution
24  */
25 @NonNullByDefault
26 public class NukiBaseResponse {
27
28     private int status;
29     @Nullable
30     private String message;
31     private boolean success;
32     private Instant created;
33
34     public NukiBaseResponse(int status, @Nullable String message) {
35         this.status = status;
36         this.message = message;
37         this.created = Instant.now();
38     }
39
40     public int getStatus() {
41         return status;
42     }
43
44     public void setStatus(int status) {
45         this.status = status;
46     }
47
48     public @Nullable String getMessage() {
49         return message;
50     }
51
52     public void setMessage(String message) {
53         this.message = message;
54     }
55
56     public boolean isSuccess() {
57         return success;
58     }
59
60     public void setSuccess(boolean success) {
61         this.success = success;
62     }
63
64     public Instant getCreated() {
65         return this.created;
66     }
67 }