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.parser.util;
10 import org.opendaylight.yangtools.yang.model.api.MustDefinition;
11 import org.opendaylight.yangtools.yang.model.api.RevisionAwareXPath;
13 final class MustDefinitionImpl implements MustDefinition {
14 private final String mustStr;
15 private final String description;
16 private final String reference;
17 private final String errorAppTag;
18 private final String errorMessage;
20 MustDefinitionImpl(String mustStr, String description, String reference, String errorAppTag, String errorMessage) {
21 this.mustStr = mustStr;
22 this.description = description;
23 this.reference = reference;
24 this.errorAppTag = errorAppTag;
25 this.errorMessage = errorMessage;
29 public String getDescription() {
34 public String getErrorAppTag() {
39 public String getErrorMessage() {
44 public String getReference() {
49 public RevisionAwareXPath getXpath() {
54 public int hashCode() {
57 result = prime * result + ((mustStr == null) ? 0 : mustStr.hashCode());
58 result = prime * result + ((description == null) ? 0 : description.hashCode());
59 result = prime * result + ((reference == null) ? 0 : reference.hashCode());
64 public boolean equals(Object obj) {
71 if (getClass() != obj.getClass()) {
74 final MustDefinitionImpl other = (MustDefinitionImpl) obj;
75 if (mustStr == null) {
76 if (other.mustStr != null) {
79 } else if (!mustStr.equals(other.mustStr)) {
82 if (description == null) {
83 if (other.description != null) {
86 } else if (!description.equals(other.description)) {
89 if (reference == null) {
90 if (other.reference != null) {
93 } else if (!reference.equals(other.reference)) {
100 public String toString() {