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.netatmo.internal.camera;
15 import java.util.Objects;
17 import org.eclipse.jdt.annotation.NonNullByDefault;
18 import org.eclipse.jdt.annotation.Nullable;
21 * {@link CameraAddress} handles the data to address a camera (VPN and local address).
23 * @author Sven Strohschein - Initial contribution
26 public class CameraAddress {
28 private final String vpnURL;
29 private final String localURL;
31 CameraAddress(final String vpnURL, final String localURL) {
33 this.localURL = localURL;
36 public String getVpnURL() {
40 public String getLocalURL() {
45 * Checks if the VPN URL was changed / isn't equal to the given VPN-URL.
47 * @param vpnURL old / known VPN URL
48 * @return true, when the VPN URL isn't equal given VPN URL, otherwise false
50 public boolean isVpnURLChanged(String vpnURL) {
51 return !getVpnURL().equals(vpnURL);
55 public boolean equals(@Nullable Object object) {
59 if (object == null || getClass() != object.getClass()) {
62 CameraAddress that = (CameraAddress) object;
63 return vpnURL.equals(that.vpnURL) && localURL.equals(that.localURL);
67 public int hashCode() {
68 return Objects.hash(vpnURL, localURL);