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.Objects;
11 import com.google.common.base.Preconditions;
12 import javax.annotation.Nonnull;
13 import javax.annotation.Nullable;
14 import org.opendaylight.yangtools.yang.common.QName;
16 class StatementIdentifier {
18 private final @Nonnull QName name;
19 private final @Nullable String argument;
21 StatementIdentifier(QName name, String argument) {
22 this.name = Preconditions.checkNotNull(name);
23 this.argument = argument;
30 String getArgument() {
35 public int hashCode() {
38 result = prime * result + name.hashCode();
39 result = prime * result + ((argument == null) ? 0 : argument.hashCode());
44 public boolean equals(Object obj) {
51 if (getClass() != obj.getClass()) {
54 StatementIdentifier other = (StatementIdentifier) obj;
55 if (!name.equals(other.name)) {
58 if (!Objects.equal(argument, other.argument)) {
65 public String toString() {
66 return "StatementIdentifier [name=" + name + ", argument=" + argument + "]";