]> git.basschouten.com Git - openhab-addons.git/blob
792a836621fda655890694d44b1ba95868337015
[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.io.neeo.internal.models;
14
15 import org.eclipse.jdt.annotation.NonNullByDefault;
16 import org.openhab.io.neeo.internal.NeeoUtil;
17
18 /**
19  * Represents a directory action request (action on a leaf value). This class is simply used for deserialization from
20  * the brain.
21  *
22  * @author Tim Roberts - Initial Contribution
23  *
24  */
25 @NonNullByDefault
26 public class NeeoDirectoryRequestAction {
27     /** The action identifier from the item */
28     private final String actionIdentifier;
29
30     /**
31      * Constructs the request action from the action identifier
32      *
33      * @param actionIdentifier a non-null, non-empty action identifier
34      */
35     public NeeoDirectoryRequestAction(String actionIdentifier) {
36         NeeoUtil.requireNotEmpty(actionIdentifier, "actionIdentifier cannot be empty");
37         this.actionIdentifier = actionIdentifier;
38     }
39
40     /**
41      * Returns the action identifier
42      *
43      * @return a non-null, non-empty action identifier
44      */
45     public String getActionIdentifier() {
46         return actionIdentifier;
47     }
48
49     @Override
50     public String toString() {
51         return "NeeoDiscoveryRequestAction [actionIdentifier=" + actionIdentifier + "]";
52     }
53 }