Renderer and OLM update
[transportpce.git] / renderer / src / main / java / org / opendaylight / transportpce / renderer / provisiondevice / tasks / RollbackTask.java
1 /*
2  * Copyright © 2017 AT&T 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.transportpce.renderer.provisiondevice.tasks;
9
10 import java.util.concurrent.Callable;
11
12 public abstract class RollbackTask implements Callable<Void> {
13
14     private final String id;
15
16     public RollbackTask(String id) {
17         this.id = id;
18     }
19
20     public String getId() {
21         return this.id;
22     }
23
24     @Override
25     public boolean equals(Object object) {
26         if (this == object) {
27             return true;
28         }
29         if ((object == null) || (getClass() != object.getClass())) {
30             return false;
31         }
32         RollbackTask that = (RollbackTask) object;
33         return this.id.equals(that.id);
34     }
35
36     @Override
37     public int hashCode() {
38         return this.id.hashCode();
39     }
40
41     public abstract boolean isRollbackNecessary();
42
43 }