]> git.basschouten.com Git - openhab-addons.git/blob
6403a72cea0a517b32e6b7ec8f8426e1a2263002
[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.homeconnect.internal.client.model;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17
18 /**
19  * Event handling model.
20  *
21  * @author Jonas BrĂ¼stel - Initial contribution
22  *
23  */
24 @NonNullByDefault
25 public enum EventHandling {
26     NONE("none"),
27     ACKNOWLEDGE("acknowledge"),
28     DECISION("decision");
29
30     private final String handling;
31
32     EventHandling(String handling) {
33         this.handling = handling;
34     }
35
36     public String getHandling() {
37         return this.handling;
38     }
39
40     public static @Nullable EventHandling valueOfHandling(String type) {
41         for (EventHandling eventType : EventHandling.values()) {
42             if (eventType.handling.equalsIgnoreCase(type)) {
43                 return eventType;
44             }
45         }
46         return null;
47     }
48 }