0893be4350b5e9095c26cc0d6b49ef9d7795baad
[netconf.git] / netconf / tools / netconf-testtool / src / main / java / org / opendaylight / netconf / test / tool / config / YangResource.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.netconf.test.tool.config;
9
10 import java.util.Objects;
11
12 public class YangResource {
13
14     private final String moduleName;
15     private final String revision;
16     private final String resourcePath;
17
18     public YangResource(String moduleName, String revision, String resourcePath) {
19         this.moduleName = moduleName;
20         this.revision = revision;
21         this.resourcePath = resourcePath;
22     }
23
24     public String getModuleName() {
25         return moduleName;
26     }
27
28     public String getRevision() {
29         return revision;
30     }
31
32     public String getResourcePath() {
33         return resourcePath;
34     }
35
36     @Override
37     public boolean equals(Object object) {
38         if (this == object) {
39             return true;
40         }
41         if (object == null || getClass() != object.getClass()) {
42             return false;
43         }
44         YangResource that = (YangResource) object;
45         return Objects.equals(moduleName, that.moduleName)
46                 && Objects.equals(revision, that.revision)
47                 && Objects.equals(resourcePath, that.resourcePath);
48     }
49
50     @Override
51     public int hashCode() {
52         return Objects.hash(moduleName, revision, resourcePath);
53     }
54
55 }