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.binding.unifi.internal.api.dto;
15 import org.openhab.binding.unifi.internal.api.cache.UniFiControllerCache;
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 implements HasId {
26 private final transient UniFiControllerCache cache;
28 public UniFiSite(final UniFiControllerCache cache) {
32 @SerializedName("_id")
40 public String getId() {
44 public String getName() {
48 public String getDescription() {
52 public UniFiControllerCache getCache() {
56 public boolean isSite(final UniFiSite site) {
57 return site != null && id.equals(site.getId());
60 public boolean matchesName(final String siteName) {
61 return siteName.equalsIgnoreCase(desc) || siteName.equalsIgnoreCase(name) || siteName.equalsIgnoreCase(id);
65 public String toString() {
66 return String.format("UniFiSite{id: '%s', name: '%s', desc: '%s'}", id, name, desc);