]> git.basschouten.com Git - openhab-addons.git/blob
1df1e9d5972d77cf50c99325a802d8a5596d878e
[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.airquality.internal.config;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.binding.airquality.internal.api.Pollutant.SensitiveGroup;
18
19 /**
20  * The {@link SensitiveGroupConfiguration} is the class used to match the
21  * sensitive-group channel configuration.
22  *
23  * @author GaĆ«l L"hopital - Initial contribution
24  */
25 @NonNullByDefault
26 public class SensitiveGroupConfiguration {
27     private String group = "RESPIRATORY";
28
29     public @Nullable SensitiveGroup asSensitiveGroup() {
30         try {
31             return SensitiveGroup.valueOf(group);
32         } catch (IllegalArgumentException e) {
33             return null;
34         }
35     }
36 }