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;
11 import org.opendaylight.yangtools.yang.binding.DataContainer;
14 * Header parser for PCEP object
16 public class ObjectHeaderImpl implements ObjectHeader {
18 private final Boolean processed;
19 private final Boolean ignored;
21 public ObjectHeaderImpl(final Boolean processed, final Boolean ignore) {
22 this.processed = processed;
23 this.ignored = ignore;
27 public Class<? extends DataContainer> getImplementedInterface() {
28 return ObjectHeader.class;
32 public Boolean isIgnore() {
37 public Boolean isProcessingRule() {
38 return this.processed;
42 public String toString() {
43 final String objectHeader = "ObjectHeader [objClass=" +
53 public int hashCode() {
56 result = prime * result + ((this.ignored == null) ? 0 : this.ignored.hashCode());
57 result = prime * result + ((this.processed == null) ? 0 : this.processed.hashCode());
62 public boolean equals(final Object obj) {
66 if (obj == null || getClass() != obj.getClass()) {
69 final ObjectHeaderImpl other = (ObjectHeaderImpl) obj;
70 if (this.ignored == null) {
71 if (other.ignored != null) {
74 } else if (!this.ignored.equals(other.ignored)) {
77 if (this.processed == null) {
78 if (other.processed != null) {
81 } else if (!this.processed.equals(other.processed)) {