Merge "Add reverse() method in Edge and Path classes"
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / TransactionIdentifier.java
1 /*
2  * Copyright (c) 2013 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.controller.config.manager.impl;
9
10 import org.opendaylight.yangtools.concepts.Identifier;
11
12 public class TransactionIdentifier implements Identifier {
13     private static final long serialVersionUID = 1L;
14     private final String name;
15
16     public TransactionIdentifier(String name) {
17         this.name = name;
18     }
19
20     @Override
21     public String toString() {
22         return "TransactionIdentifier{" + "name='" + name + '\'' + '}';
23     }
24
25     public String getName() {
26         return name;
27     }
28
29     @Override
30     public boolean equals(Object o) {
31         if (this == o) {
32             return true;
33         }
34         if (o == null || getClass() != o.getClass()) {
35             return false;
36         }
37
38         TransactionIdentifier that = (TransactionIdentifier) o;
39
40         if (name != null ? !name.equals(that.name) : that.name != null) {
41             return false;
42         }
43
44         return true;
45     }
46
47     @Override
48     public int hashCode() {
49         return name != null ? name.hashCode() : 0;
50     }
51 }