]> git.basschouten.com Git - openhab-addons.git/blob
49664b0dbc57fae746a6c887b0d73ede7e55861d
[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.hdpowerview.internal.api.responses;
14
15 import java.util.Base64;
16 import java.util.List;
17
18 import org.eclipse.jdt.annotation.NonNullByDefault;
19 import org.eclipse.jdt.annotation.Nullable;
20
21 /**
22  * State of all Scenes in an HD PowerView hub
23  *
24  * @author Andy Lintner - Initial contribution
25  */
26 @NonNullByDefault
27 public class Scenes {
28
29     public @Nullable List<Scene> sceneData;
30     public @Nullable List<Integer> sceneIds;
31
32     /*
33      * the following SuppressWarnings annotation is because the Eclipse compiler
34      * does NOT expect a NonNullByDefault annotation on the inner class, since it is
35      * implicitly inherited from the outer class, whereas the Maven compiler always
36      * requires an explicit NonNullByDefault annotation on all classes
37      */
38     @SuppressWarnings("null")
39     @NonNullByDefault
40     public static class Scene {
41         public int id;
42         public @Nullable String name;
43         public int roomId;
44         public int order;
45         public int colorId;
46         public int iconId;
47
48         public String getName() {
49             return new String(Base64.getDecoder().decode(name));
50         }
51     }
52 }