]> git.basschouten.com Git - openhab-addons.git/blob
008f44c0793e920370323d68d4ea14e8877e2ba2
[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 level model.
20  *
21  * @author Jonas BrĂ¼stel - Initial contribution
22  *
23  */
24 @NonNullByDefault
25 public enum EventLevel {
26     CRITICAL("critical"),
27     ALERT("alert"),
28     WARNING("warning"),
29     HINT("hint"),
30     INFO("info");
31
32     private final String level;
33
34     EventLevel(String level) {
35         this.level = level;
36     }
37
38     public String getLevel() {
39         return this.level;
40     }
41
42     public static @Nullable EventLevel valueOfLevel(String type) {
43         for (EventLevel eventType : EventLevel.values()) {
44             if (eventType.level.equalsIgnoreCase(type)) {
45                 return eventType;
46             }
47         }
48         return null;
49     }
50 }