From: guillaume.lambert Date: Thu, 5 Aug 2021 13:43:53 +0000 (+0200) Subject: Refactor Renderer DeviceRenderingResult class X-Git-Tag: 4.0.0~45^2~5 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=bc148fbcd6b62f1eb2487336e6a44ddbe8c07d9e;p=transportpce.git Refactor Renderer DeviceRenderingResult class JIRA: TRNSPRTPCE-491 Signed-off-by: guillaume.lambert Change-Id: I80720d752c072b1f821053716a2ae48692dca087 --- diff --git a/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRenderingResult.java b/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRenderingResult.java index 2bc1b0d19..121790a31 100644 --- a/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRenderingResult.java +++ b/renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRenderingResult.java @@ -23,21 +23,18 @@ public final class DeviceRenderingResult extends OperationResult { private DeviceRenderingResult(boolean success, String message, List olmList, List renderedNodeInterfaces, List otnLinkTps) { super(success, message); - if (olmList != null) { - this.olmList = Collections.unmodifiableList(olmList); - } else { - this.olmList = Collections.emptyList(); - } - if (renderedNodeInterfaces != null) { - this.renderedNodeInterfaces = Collections.unmodifiableList(renderedNodeInterfaces); - } else { - this.renderedNodeInterfaces = Collections.emptyList(); - } - if (otnLinkTps != null) { - this.otnLinkTps = Collections.unmodifiableList(otnLinkTps); - } else { - this.otnLinkTps = Collections.emptyList(); - } + this.olmList = + olmList == null + ? Collections.emptyList() + : Collections.unmodifiableList(olmList); + this.renderedNodeInterfaces = + renderedNodeInterfaces == null + ? Collections.emptyList() + : Collections.unmodifiableList(renderedNodeInterfaces); + this.otnLinkTps = + otnLinkTps == null + ? Collections.emptyList() + : Collections.unmodifiableList(otnLinkTps); } public List getOlmList() { @@ -57,7 +54,7 @@ public final class DeviceRenderingResult extends OperationResult { } public static DeviceRenderingResult ok(List olmNodeList, List renderedNodeInterfaces, - List otnLinkTps) { + List otnLinkTps) { return new DeviceRenderingResult(true, "", olmNodeList, renderedNodeInterfaces, otnLinkTps); }