Initial code drop of yang model driven configuration system
[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.protocol.concepts.Identifier;
11
12 public class TransactionIdentifier implements Identifier {
13     private final String name;
14
15     public TransactionIdentifier(String name) {
16         this.name = name;
17     }
18
19     @Override
20     public String toString() {
21         return "TransactionIdentifier{" + "name='" + name + '\'' + '}';
22     }
23
24     public String getName() {
25         return name;
26     }
27
28     @Override
29     public boolean equals(Object o) {
30         if (this == o)
31             return true;
32         if (o == null || getClass() != o.getClass())
33             return false;
34
35         TransactionIdentifier that = (TransactionIdentifier) o;
36
37         if (name != null ? !name.equals(that.name) : that.name != null)
38             return false;
39
40         return true;
41     }
42
43     @Override
44     public int hashCode() {
45         return name != null ? name.hashCode() : 0;
46     }
47 }