2 * Copyright (c) 2015 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.parser.stmt.reactor;
10 import com.google.common.base.Preconditions;
11 import java.util.Objects;
12 import javax.annotation.Nonnull;
13 import javax.annotation.Nullable;
14 import org.opendaylight.yangtools.yang.common.QName;
16 class StatementIdentifier {
18 private final QName name;
19 private final String argument;
21 StatementIdentifier(@Nonnull final QName name, @Nullable final String argument) {
22 this.name = Preconditions.checkNotNull(name);
23 this.argument = argument;
26 @Nonnull QName getName() {
30 @Nullable String getArgument() {
35 public int hashCode() {
38 result = prime * result + name.hashCode();
39 result = prime * result + Objects.hashCode(argument);
44 public boolean equals(final Object obj) {
51 if (getClass() != obj.getClass()) {
54 StatementIdentifier other = (StatementIdentifier) obj;
55 if (!name.equals(other.name)) {
58 return Objects.equals(argument, other.argument);
62 public String toString() {
63 return "StatementIdentifier [name=" + name + ", argument=" + argument + "]";