2 * Copyright © 2020 AT&T 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;
11 import java.util.Collections;
12 import java.util.List;
13 import org.opendaylight.transportpce.common.OperationResult;
14 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev201211.node.interfaces.NodeInterface;
16 public final class OtnDeviceRenderingResult extends OperationResult {
17 private final List<NodeInterface> renderedNodeInterfaces;
19 private OtnDeviceRenderingResult(boolean success, String message, List<NodeInterface> renderedNodeInterfaces) {
20 super(success, message);
21 if (renderedNodeInterfaces != null) {
22 this.renderedNodeInterfaces = Collections.unmodifiableList(renderedNodeInterfaces);
24 this.renderedNodeInterfaces = Collections.emptyList();
28 public List<NodeInterface> getRenderedNodeInterfaces() {
29 return this.renderedNodeInterfaces;
32 public static OtnDeviceRenderingResult failed(String message) {
33 return new OtnDeviceRenderingResult(false, message, null);
36 public static OtnDeviceRenderingResult ok(List<NodeInterface> renderedNodeInterfaces) {
37 return new OtnDeviceRenderingResult(true, "", renderedNodeInterfaces);