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.yangtools.yang.data.impl.schema.nodes;
10 import java.util.Objects;
11 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument;
13 public abstract class AbstractImmutableNormalizedSimpleValueNode<K extends PathArgument,V>
14 extends AbstractImmutableNormalizedValueNode<K, V> {
15 protected AbstractImmutableNormalizedSimpleValueNode(final K nodeIdentifier, final V value) {
16 super(nodeIdentifier, value);
20 protected int valueHashCode() {
21 final V local = value();
22 final int result = local != null ? local.hashCode() : 1;
23 // FIXME: are attributes part of hashCode/equals?
28 protected boolean valueEquals(final AbstractImmutableNormalizedNode<?, ?> other) {
29 // We can not call directly getValue.equals because of Empty Type
30 // RequireInstanceStatementSupport leaves which always have NULL value
32 // FIXME: are attributes part of hashCode/equals?
33 return Objects.deepEquals(value(), other.getValue());