2 * Copyright © 2017 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
8 package org.opendaylight.transportpce.renderer.provisiondevice;
10 import java.util.Collections;
11 import java.util.List;
12 import org.opendaylight.transportpce.common.OperationResult;
13 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200128.node.interfaces.NodeInterface;
14 import org.opendaylight.yang.gen.v1.http.org.transportpce.common.types.rev200128.olm.renderer.input.Nodes;
16 public final class DeviceRenderingResult extends OperationResult {
18 private final List<Nodes> olmList;
19 private final List<NodeInterface> renderedNodeInterfaces;
21 private DeviceRenderingResult(boolean success, String message, List<Nodes> olmList,
22 List<NodeInterface> renderedNodeInterfaces) {
23 super(success, message);
24 if (olmList != null) {
25 this.olmList = Collections.unmodifiableList(olmList);
27 this.olmList = Collections.emptyList();
30 if (renderedNodeInterfaces != null) {
31 this.renderedNodeInterfaces = Collections.unmodifiableList(renderedNodeInterfaces);
33 this.renderedNodeInterfaces = Collections.emptyList();
37 public List<Nodes> getOlmList() {
41 public List<NodeInterface> getRenderedNodeInterfaces() {
42 return this.renderedNodeInterfaces;
45 public static DeviceRenderingResult failed(String message) {
46 return new DeviceRenderingResult(false, message, null, null);
49 public static DeviceRenderingResult ok(List<Nodes> olmList, List<NodeInterface> renderedNodeInterfaces) {
50 return new DeviceRenderingResult(true, "", olmList, renderedNodeInterfaces);