2 * Copyright © 2024 Smartoptics 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
9 package org.opendaylight.transportpce.renderer.provisiondevice.transaction;
11 import java.util.Objects;
12 import org.opendaylight.transportpce.renderer.provisiondevice.transaction.delete.Delete;
14 public class DeviceInterface implements Transaction {
16 private final String nodeId;
18 private final String interfaceId;
20 public DeviceInterface(String nodeId, String interfaceId) {
22 this.interfaceId = interfaceId;
26 public boolean rollback(Delete delete) {
27 return delete.deleteInterface(nodeId, interfaceId);
31 public String description() {
32 return String.format("Node: %s interface id: %s", nodeId, interfaceId);
36 public int hashCode() {
37 return Objects.hash(nodeId, interfaceId);
41 public boolean equals(Object object) {
45 if (!(object instanceof DeviceInterface)) {
48 DeviceInterface that = (DeviceInterface) object;
49 return Objects.equals(nodeId, that.nodeId) && Objects.equals(interfaceId,