2 * Copyright (c) 2010-2023 Contributors to the openHAB project
4 * See the NOTICE file(s) distributed with this work for additional
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
11 * SPDX-License-Identifier: EPL-2.0
13 package org.openhab.io.neeo.internal.models;
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.eclipse.jdt.annotation.Nullable;
17 import org.openhab.io.neeo.internal.NeeoUtil;
20 * Represents a list item for the directory.
22 * @author Tim Roberts - Initial Contribution
26 public class NeeoDeviceChannelDirectoryListItem {
28 /** The item value that will be used when the item is selected */
29 private final String itemValue;
31 /** The title (label) of the item */
32 private final String title;
34 /** The optional thumbnail URI to represent the item */
36 private final String thumbNailUri;
38 /** The ui action for the item */
40 private final ListUiAction uiAction;
43 * Constructs the list item from the attributes
45 * @param itemValue a possibly null, possibly empty item value
46 * @param title a non-null, non-empty title
47 * @param thumbNailUri a possibly null, possibly empty thumbnail URI
48 * @param uiAction the non-null UI action
50 public NeeoDeviceChannelDirectoryListItem(String itemValue, String title, @Nullable String thumbNailUri,
51 ListUiAction uiAction) {
52 NeeoUtil.requireNotEmpty(title, "title cannot be empty");
53 this.itemValue = itemValue;
55 this.thumbNailUri = thumbNailUri;
56 this.uiAction = uiAction;
62 * @return a possibly null, possibly empty item value
64 public String getItemValue() {
69 * The title for the item
71 * @return a non-null, non-empty title
73 public String getTitle() {
78 * The optional thumbnail URI
80 * @return a possibly null, possibly empty thumbnail URI
83 public String getThumbNailUri() {
88 * The UI Action to perform
90 * @return the UI action
93 public ListUiAction getUiAction() {
98 public String toString() {
99 return "NeeoDeviceChannelDirectoryListItem [itemValue=" + itemValue + ", title=" + title + ", thumbNailUri="
100 + thumbNailUri + ", uiAction=" + uiAction + "]";