]> git.basschouten.com Git - openhab-addons.git/blob
50cc7d324c2f3368e99cf4e83a33e52ea09dde84
[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  * The model representing an adapter registration (serialize/deserialize json use only).
20  *
21  * @author Tim Roberts - Initial Contribution
22  */
23 @NonNullByDefault
24 public class NeeoAdapterRegistration {
25
26     /** The name. */
27     private final String name;
28
29     /** The callback url */
30     private final String baseUrl;
31
32     /**
33      * Creates the adapter registration from the name and callback url
34      *
35      * @param name the name
36      * @param baseUrl the base url
37      */
38     public NeeoAdapterRegistration(String name, String baseUrl) {
39         NeeoUtil.requireNotEmpty(name, "name cannot be empty");
40         NeeoUtil.requireNotEmpty(baseUrl, "baseUrl cannot be empty");
41
42         this.name = name;
43         this.baseUrl = baseUrl;
44     }
45
46     /**
47      * Gets the name.
48      *
49      * @return the name
50      */
51     public String getName() {
52         return name;
53     }
54
55     /**
56      * Gets the callback url.
57      *
58      * @return the callback url
59      */
60     public String getBaseUrl() {
61         return baseUrl;
62     }
63
64     @Override
65     public String toString() {
66         return "NeeoAdapterRegistration [name=" + name + ", baseUrl=" + baseUrl + "]";
67     }
68 }