2 * Copyright (c) 2014 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.yangtools.yang.data.impl.codec;
10 import java.util.Map.Entry;
11 import java.util.Objects;
12 import org.opendaylight.yangtools.yang.common.QName;
14 public class ValueWithQName<V> implements Entry<QName, V>{
18 public ValueWithQName(final QName qname, final V value) {
24 public QName getQname() {
34 public QName getKey() {
39 public V setValue(final V value) {
40 throw new UnsupportedOperationException();
44 public int hashCode() {
47 result = prime * result + Objects.hashCode(qname);
48 result = prime * result + Objects.hashCode(value);
53 public boolean equals(final Object obj) {
60 if (getClass() != obj.getClass()) {
63 @SuppressWarnings("rawtypes")
64 ValueWithQName other = (ValueWithQName) obj;
66 if (other.qname != null) {
69 } else if (!qname.equals(other.qname)) {
73 if (other.value != null) {
76 } else if (!value.equals(other.value)) {