2 * Copyright (c) 2010-2021 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.binding.unifi.internal.api.model;
15 import org.apache.commons.lang.StringUtils;
17 import com.google.gson.annotations.SerializedName;
20 * The {@link UniFiSite} represents the data model of a UniFi site.
22 * @author Matthew Bowman - Initial contribution
24 public class UniFiSite {
26 private final transient UniFiController controller;
28 public UniFiSite(UniFiController controller) {
29 this.controller = controller;
32 @SerializedName("_id")
39 public String getId() {
43 public String getName() {
47 public String getDescription() {
51 public boolean matchesName(String siteName) {
52 return StringUtils.equalsIgnoreCase(desc, siteName) || StringUtils.equalsIgnoreCase(name, siteName)
53 || StringUtils.equalsIgnoreCase(id, siteName);
57 public String toString() {
58 return String.format("UniFiSite{name: '%s', desc: '%s'}", name, desc);