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.spi;
10 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev181109.ObjectHeader;
13 * Header parser for PCEP object.
15 public class ObjectHeaderImpl implements ObjectHeader {
17 private final Boolean processed;
18 private final Boolean ignored;
20 public ObjectHeaderImpl(final Boolean processed, final Boolean ignore) {
21 this.processed = processed;
22 this.ignored = ignore;
26 public Class<ObjectHeader> implementedInterface() {
27 return ObjectHeader.class;
31 public Boolean isIgnore() {
36 public Boolean isProcessingRule() {
37 return this.processed;
41 public String toString() {
42 final String objectHeader = "ObjectHeader [objClass="
43 + ", processed=" + this.processed
44 + ", ignored=" + this.ignored
50 public int hashCode() {
53 result = prime * result + (this.ignored == null ? 0 : this.ignored.hashCode());
54 result = prime * result + (this.processed == null ? 0 : this.processed.hashCode());
59 public boolean equals(final Object obj) {
63 if (obj == null || getClass() != obj.getClass()) {
66 final ObjectHeaderImpl other = (ObjectHeaderImpl) obj;
67 if (this.ignored == null) {
68 if (other.ignored != null) {
71 } else if (!this.ignored.equals(other.ignored)) {
74 if (this.processed == null) {
75 if (other.processed != null) {
78 } else if (!this.processed.equals(other.processed)) {