2 * Copyright (c) 2010-2020 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.gardena.internal.model;
15 import java.util.ArrayList;
16 import java.util.List;
18 import org.apache.commons.lang.builder.EqualsBuilder;
19 import org.apache.commons.lang.builder.HashCodeBuilder;
21 import com.google.gson.annotations.SerializedName;
24 * Represents a Gardena location.
26 * @author Gerhard Riegler - Initial contribution
28 public class Location {
32 @SerializedName("devices")
33 public List<String> deviceIds = new ArrayList<>();
36 * Returns the id of the location.
38 public String getId() {
43 * Returns the name of the location.
45 public String getName() {
50 * Returns the device ids of the location.
52 public List<String> getDeviceIds() {
57 public int hashCode() {
58 return new HashCodeBuilder().append(id).toHashCode();
62 public boolean equals(Object obj) {
63 if (obj == null || !(obj instanceof Location)) {
66 Location comp = (Location) obj;
67 return new EqualsBuilder().append(comp.getId(), id).isEquals();