diff options
author | Marek Gradzki <mgradzki@cisco.com> | 2016-06-05 15:59:38 +0200 |
---|---|---|
committer | Marek Gradzki <mgradzki@cisco.com> | 2016-06-06 15:32:43 +0000 |
commit | 8014d193008a60ef3857f14d57d931973daa7cc4 (patch) | |
tree | d88fbd0d0e5efbdbeab36297e56549ef1ea9cff1 /v3po/v3po2vpp | |
parent | 4f7fb7f2e12687d42a6ae287531bb788636a8bc6 (diff) |
Fix CUD support for non-mandatory child nodes of list type
Change-Id: Ic75221fe61a0bb35753dd6f3b4deec1b8c020974
Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp')
3 files changed, 10 insertions, 7 deletions
diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/InterfaceCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/InterfaceCustomizer.java index 4e81ca0f2..3a4638d90 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/InterfaceCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/InterfaceCustomizer.java @@ -16,6 +16,7 @@ package io.fd.honeycomb.v3po.translate.v3po.interfaces; +import com.google.common.base.Optional; import io.fd.honeycomb.v3po.translate.spi.write.ListWriterCustomizer; import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; import io.fd.honeycomb.v3po.translate.v3po.util.FutureJVppCustomizer; @@ -89,9 +90,9 @@ public class InterfaceCustomizer extends FutureJVppCustomizer implements ListWri @Nonnull @Override - public List<Interface> extract(@Nonnull final InstanceIdentifier<Interface> currentId, + public Optional<List<Interface>> extract(@Nonnull final InstanceIdentifier<Interface> currentId, @Nonnull final DataObject parentData) { - return ((Interfaces) parentData).getInterface(); + return Optional.fromNullable(((Interfaces) parentData).getInterface()); } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizer.java index b6c8d9a59..cb0a2c3df 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/interfaces/SubInterfaceCustomizer.java @@ -20,6 +20,7 @@ import static com.google.common.base.Preconditions.checkState; import static io.fd.honeycomb.v3po.translate.v3po.util.SubInterfaceUtils.getSubInterfaceName; import static io.fd.honeycomb.v3po.translate.v3po.util.TranslateUtils.booleanToByte; +import com.google.common.base.Optional; import com.google.common.base.Preconditions; import io.fd.honeycomb.v3po.translate.spi.write.ListWriterCustomizer; import io.fd.honeycomb.v3po.translate.v3po.util.FutureJVppCustomizer; @@ -74,9 +75,9 @@ public class SubInterfaceCustomizer extends FutureJVppCustomizer @Nonnull @Override - public List<SubInterface> extract(@Nonnull final InstanceIdentifier<SubInterface> currentId, + public Optional<List<SubInterface>> extract(@Nonnull final InstanceIdentifier<SubInterface> currentId, @Nonnull final DataObject parentData) { - return ((SubInterfaces) parentData).getSubInterface(); + return Optional.fromNullable(((SubInterfaces) parentData).getSubInterface()); } diff --git a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/vpp/BridgeDomainCustomizer.java b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/vpp/BridgeDomainCustomizer.java index 0b3545ddd..750ff575e 100644 --- a/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/vpp/BridgeDomainCustomizer.java +++ b/v3po/v3po2vpp/src/main/java/io/fd/honeycomb/v3po/translate/v3po/vpp/BridgeDomainCustomizer.java @@ -19,12 +19,13 @@ package io.fd.honeycomb.v3po.translate.v3po.vpp; import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkNotNull; +import com.google.common.base.Optional; import com.google.common.base.Preconditions; import io.fd.honeycomb.v3po.translate.spi.write.ListWriterCustomizer; import io.fd.honeycomb.v3po.translate.v3po.util.FutureJVppCustomizer; import io.fd.honeycomb.v3po.translate.v3po.util.NamingContext; -import io.fd.honeycomb.v3po.translate.v3po.util.VppApiInvocationException; import io.fd.honeycomb.v3po.translate.v3po.util.TranslateUtils; +import io.fd.honeycomb.v3po.translate.v3po.util.VppApiInvocationException; import io.fd.honeycomb.v3po.translate.write.WriteContext; import io.fd.honeycomb.v3po.translate.write.WriteFailedException; import java.util.List; @@ -57,9 +58,9 @@ public class BridgeDomainCustomizer @Nonnull @Override - public List<BridgeDomain> extract(@Nonnull final InstanceIdentifier<BridgeDomain> currentId, + public Optional<List<BridgeDomain>> extract(@Nonnull final InstanceIdentifier<BridgeDomain> currentId, @Nonnull final DataObject parentData) { - return ((BridgeDomains) parentData).getBridgeDomain(); + return Optional.fromNullable(((BridgeDomains) parentData).getBridgeDomain()); } private BridgeDomainAddDelReply addOrUpdateBridgeDomain(final int bdId, @Nonnull final BridgeDomain bd) |