2 * Copyright (c) 2014 Contextream, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.lispflowmapping.interfaces.dao;
10 import java.util.List;
13 * A value in the mapping service. It contains a list of the RLOCs, and a
16 public class MappingServiceValue {
18 private List<MappingServiceRLOC> rlocs;
21 private final static MappingServiceValue EMPTY_MAPPING_SERVICE_VALUE = new MappingServiceValue();
23 public MappingServiceValue() {
26 public MappingServiceValue(List<MappingServiceRLOC> rlocs, String key) {
31 public List<MappingServiceRLOC> getRlocs() {
35 public void setRlocs(List<MappingServiceRLOC> rlocs) {
39 public String getKey() {
43 public void setKey(String key) {
47 public boolean isEmpty() {
48 return equals(EMPTY_MAPPING_SERVICE_VALUE);
52 public int hashCode() {
55 result = prime * result + ((key == null) ? 0 : key.hashCode());
56 result = prime * result + ((rlocs == null) ? 0 : rlocs.hashCode());
61 public boolean equals(Object obj) {
66 if (getClass() != obj.getClass())
68 MappingServiceValue other = (MappingServiceValue) obj;
70 if (other.key != null)
72 } else if (!key.equals(other.key))
75 if (other.rlocs != null)
77 } else if (!rlocs.equals(other.rlocs))
83 public String toString() {
84 StringBuilder sb = new StringBuilder();
85 return sb.append("MappingServiceValue: Password: ").append(key).append(" RLOCs: ").append(rlocs).toString();