]> git.basschouten.com Git - openhab-addons.git/blob
13ea3b1c93306f15df70c6594e258924f73e9ee9
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2021 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     SRGB(0x01),
30     NORMAL(0x02),
31     MEETING(0x03),
32     PRESENTATION(0x04),
33     CINEMANIGHT(0x05),
34     DYNAMIC(0x06),
35     NATURAL(0x07),
36     SPORTS(0x08),
37     HD(0x09),
38     CUSTOM(0x10),
39     BLACKBOARD(0x11),
40     WHITEBOARD(0x12),
41     THX(0x13),
42     PHOTO(0x14),
43     CINEMA(0x15),
44     UNKNOWN16(0x16),
45     CINEMA3D(0x17),
46     DYNAMIC3D(0x18),
47     THX3D(0x19),
48     BWCINEMA(0x20),
49     UNKNOWN21(0x21),
50     DIGITALCINEMA(0x22),
51     SILVER(0x0A),
52     XVCOLOR(0x0B),
53     LIVINGROOM(0x0C),
54     DICOMSIM(0x0F),
55     UNKNOWN(0xFF);
56
57     private final int value;
58
59     ColorMode(int value) {
60         this.value = value;
61     }
62
63     public static ColorMode forValue(int value) {
64         try {
65             return Arrays.stream(values()).filter(e -> e.value == value).findFirst().get();
66         } catch (NoSuchElementException e) {
67             return UNKNOWN;
68         }
69     }
70
71     public int toInt() {
72         return value;
73     }
74 }