Cleanup test format
[controller.git] / opendaylight / md-sal / eos-dom-akka / src / main / java / org / opendaylight / controller / eos / akka / owner / checker / command / GetEntityOwnerReply.java
1 /*
2  * Copyright (c) 2021 PANTHEON.tech, s.r.o. 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.controller.eos.akka.owner.checker.command;
9
10 import java.io.Serializable;
11 import org.eclipse.jdt.annotation.NonNull;
12 import org.eclipse.jdt.annotation.Nullable;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.entity.owners.norev.GetEntityOwnerOutput;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.entity.owners.norev.GetEntityOwnerOutputBuilder;
15 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.entity.owners.norev.NodeName;
16
17 public final class GetEntityOwnerReply extends StateCheckerReply implements Serializable {
18     private static final long serialVersionUID = 1L;
19
20     private final String owner;
21
22     public GetEntityOwnerReply(final @Nullable String owner) {
23         this.owner = owner;
24     }
25
26     public @NonNull GetEntityOwnerOutput toOutput() {
27         final GetEntityOwnerOutputBuilder builder = new GetEntityOwnerOutputBuilder();
28         if (owner != null) {
29             builder.setOwnerNode(new NodeName(owner));
30         }
31         return builder.build();
32     }
33 }