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.controller.yang.parser.util;
10 import org.opendaylight.controller.yang.model.api.MustDefinition;
11 import org.opendaylight.controller.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,
21 String errorAppTag, String errorMessage) {
22 this.mustStr = mustStr;
23 this.description = description;
24 this.reference = reference;
25 this.errorAppTag = errorAppTag;
26 this.errorMessage = errorMessage;
30 public String getDescription() {
35 public String getErrorAppTag() {
40 public String getErrorMessage() {
45 public String getReference() {
50 public RevisionAwareXPath getXpath() {
55 public int hashCode() {
58 result = prime * result + ((mustStr == null) ? 0 : mustStr.hashCode());
59 result = prime * result
60 + ((description == null) ? 0 : description.hashCode());
61 result = prime * result
62 + ((reference == null) ? 0 : reference.hashCode());
67 public boolean equals(Object obj) {
74 if (getClass() != obj.getClass()) {
77 final MustDefinitionImpl other = (MustDefinitionImpl) obj;
78 if (mustStr == null) {
79 if (other.mustStr != null) {
82 } else if (!mustStr.equals(other.mustStr)) {
85 if (description == null) {
86 if (other.description != null) {
89 } else if (!description.equals(other.description)) {
92 if (reference == null) {
93 if (other.reference != null) {
96 } else if (!reference.equals(other.reference)) {
103 public String toString() {