]> git.basschouten.com Git - openhab-addons.git/blob
7a27ff721fa0336f6638eb87c5b2bac34cd62dc2
[openhab-addons.git] /
1 /**
2  * Copyright (c) 2010-2024 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.hue.internal.api.dto.clip2;
14
15 import java.lang.reflect.Type;
16 import java.util.ArrayList;
17 import java.util.List;
18 import java.util.Objects;
19
20 import org.eclipse.jdt.annotation.NonNullByDefault;
21 import org.eclipse.jdt.annotation.Nullable;
22
23 import com.google.gson.reflect.TypeToken;
24
25 /**
26  * DTO for CLIP 2 event stream objects.
27  *
28  * @author Andrew Fiddian-Green - Initial contribution
29  */
30 @NonNullByDefault
31 public class Event {
32     public static final Type EVENT_LIST_TYPE = new TypeToken<List<Event>>() {
33     }.getType();
34
35     private @Nullable List<Resource> data = new ArrayList<>();
36
37     public List<Resource> getData() {
38         List<Resource> data = this.data;
39         return Objects.nonNull(data) ? data : List.of();
40     }
41 }