]> git.basschouten.com Git - openhab-addons.git/blob
50b30ef1dcb4e6416927ae0a194c11bec7b42301
[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.hue.internal.api.dto.clip2;
14
15 import java.time.Instant;
16
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.openhab.binding.hue.internal.api.dto.clip2.enums.TamperStateType;
19
20 /**
21  * DTO for CLIP 2 home security tamper switch.
22  *
23  * @author Andrew Fiddian-Green - Initial contribution
24  */
25 @NonNullByDefault
26 public class TamperReport {
27
28     private @NonNullByDefault({}) Instant changed;
29     private @NonNullByDefault({}) String state;
30
31     public Instant getLastChanged() {
32         return changed;
33     }
34
35     public TamperStateType getTamperState() throws IllegalArgumentException {
36         return TamperStateType.valueOf(state.toUpperCase());
37     }
38
39     public TamperReport setLastChanged(Instant changed) {
40         this.changed = changed;
41         return this;
42     }
43
44     public TamperReport setTamperState(String state) {
45         this.state = state;
46         return this;
47     }
48 }