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.binding;
10 import org.opendaylight.yangtools.concepts.Builder;
12 final class HashCodeBuilder<T> implements Builder<Integer> {
13 private int currentHash;
15 public HashCodeBuilder() {
19 public HashCodeBuilder(final int seedHash) {
20 this.currentHash = seedHash;
23 public static int nextHashCode(final int hashCode, final Object arg) {
24 return 31 * hashCode + arg.hashCode();
27 void addArgument(final T arg) {
28 currentHash = nextHashCode(currentHash, arg);
32 public Integer toInstance() {