]> git.basschouten.com Git - openhab-addons.git/blob
4531d07e4fa213ee053d89aafdcbcf8ff0024a5b
[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.epsonprojector.internal.enums;
14
15 import java.util.Arrays;
16 import java.util.NoSuchElementException;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19
20 /**
21  * Valid values for ColorMode.
22  *
23  * @author Pauli Anttila - Initial contribution
24  * @author Yannick Schaus - Refactoring
25  * @author Michael Lobstein - Improvements for OH3
26  */
27 @NonNullByDefault
28 public enum ColorMode {
29     AUTO(0x00),
30     SRGB(0x01),
31     NORMAL(0x02),
32     MEETING(0x03),
33     PRESENTATION(0x04),
34     CINEMANIGHT(0x05),
35     DYNAMIC(0x06),
36     NATURAL(0x07),
37     SPORTS(0x08),
38     HD(0x09),
39     CUSTOM(0x10),
40     BLACKBOARD(0x11),
41     WHITEBOARD(0x12),
42     THX(0x13),
43     PHOTO(0x14),
44     CINEMA(0x15),
45     UNKNOWN16(0x16),
46     CINEMA3D(0x17),
47     DYNAMIC3D(0x18),
48     THX3D(0x19),
49     BWCINEMA(0x20),
50     UNKNOWN21(0x21),
51     DIGITALCINEMA(0x22),
52     SILVER(0x0A),
53     XVCOLOR(0x0B),
54     LIVINGROOM(0x0C),
55     DICOMSIM(0x0F),
56     UNKNOWN(0xFF);
57
58     private final int value;
59
60     ColorMode(int value) {
61         this.value = value;
62     }
63
64     public static ColorMode forValue(int value) {
65         try {
66             return Arrays.stream(values()).filter(e -> e.value == value).findFirst().get();
67         } catch (NoSuchElementException e) {
68             return UNKNOWN;
69         }
70     }
71
72     public int toInt() {
73         return value;
74     }
75 }