2 * Copyright (c) 2013 Cisco Systems, 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.protocol.pcep;
10 import org.opendaylight.protocol.framework.SessionPreferences;
11 import org.opendaylight.protocol.pcep.object.PCEPOpenObject;
14 * Implementation of {@link SessionPreferences}.
16 public final class PCEPSessionPreferences implements SessionPreferences {
18 private final PCEPOpenObject openObject;
21 * Construct new session preferences.
23 * @param openObject encapsulated PCEP OPEN object
25 public PCEPSessionPreferences(final PCEPOpenObject openObject) {
26 this.openObject = openObject;
30 * Return the encapsulated OPEN object.
32 * @return encapsulated OPEN object.
34 public PCEPOpenObject getOpenObject() {
35 return this.openObject;
39 public int hashCode() {
42 result = prime * result
43 + ((this.openObject == null) ? 0 : this.openObject.hashCode());
48 public boolean equals(Object obj) {
53 if (!(obj instanceof PCEPSessionPreferences))
55 final PCEPSessionPreferences other = (PCEPSessionPreferences) obj;
56 if (this.openObject == null) {
57 if (other.openObject != null)
59 } else if (!this.openObject.equals(other.openObject))