]> git.basschouten.com Git - openhab-addons.git/blob
d6597e025cc1ec4fc03582994ace992e644f548d
[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.unifi.internal.api.model;
14
15 import com.google.gson.annotations.SerializedName;
16
17 /**
18  * The {@link UniFiSite} represents the data model of a UniFi site.
19  *
20  * @author Matthew Bowman - Initial contribution
21  */
22 public class UniFiSite {
23
24     private final transient UniFiController controller;
25
26     public UniFiSite(UniFiController controller) {
27         this.controller = controller;
28     }
29
30     @SerializedName("_id")
31     private String id;
32
33     private String name;
34
35     private String desc;
36
37     public String getId() {
38         return id;
39     }
40
41     public String getName() {
42         return name;
43     }
44
45     public String getDescription() {
46         return desc;
47     }
48
49     public boolean matchesName(String siteName) {
50         return siteName.equalsIgnoreCase(desc) || siteName.equalsIgnoreCase(name) || siteName.equalsIgnoreCase(id);
51     }
52
53     @Override
54     public String toString() {
55         return String.format("UniFiSite{name: '%s', desc: '%s'}", name, desc);
56     }
57 }