X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-binding-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fbinding%2Fimpl%2FLazyDataObjectModification.java;h=1170828ce94946a023c2b5c437a860f91e2244f5;hp=a165242b30f08d29902240d868b24ca84464fde9;hb=b830d5ede22e323fe724cd747fe99280dfa2240d;hpb=c58a4036d120482ce18f247bb1b283193cab60d1 diff --git a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LazyDataObjectModification.java b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LazyDataObjectModification.java index a165242b30..1170828ce9 100644 --- a/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LazyDataObjectModification.java +++ b/opendaylight/md-sal/sal-binding-broker/src/main/java/org/opendaylight/controller/md/sal/binding/impl/LazyDataObjectModification.java @@ -37,7 +37,7 @@ import org.slf4j.LoggerFactory; * * @param Type of Binding Data Object */ -class LazyDataObjectModification implements DataObjectModification { +final class LazyDataObjectModification implements DataObjectModification { private final static Logger LOG = LoggerFactory.getLogger(LazyDataObjectModification.class); @@ -57,9 +57,9 @@ class LazyDataObjectModification implements DataObjectModi return new LazyDataObjectModification<>(codec,domData); } - static Collection> from(final BindingCodecTreeNode parentCodec, + private static Collection> from(final BindingCodecTreeNode parentCodec, final Collection domChildNodes) { - final ArrayList> result = new ArrayList<>(domChildNodes.size()); + final List> result = new ArrayList<>(domChildNodes.size()); populateList(result, parentCodec, domChildNodes); return result; } @@ -79,7 +79,7 @@ class LazyDataObjectModification implements DataObjectModi parentCodec.yangPathArgumentChild(domChildNode.getIdentifier()); populateList(result,type, childCodec, domChildNode); } catch (final IllegalArgumentException e) { - if(type == BindingStructuralType.UNKNOWN) { + if (type == BindingStructuralType.UNKNOWN) { LOG.debug("Unable to deserialize unknown DOM node {}",domChildNode,e); } else { LOG.debug("Binding representation for DOM node {} was not found",domChildNode,e); @@ -89,7 +89,6 @@ class LazyDataObjectModification implements DataObjectModi } } - private static void populateList(final List> result, final BindingStructuralType type, final BindingCodecTreeNode childCodec, final DataTreeCandidateNode domChildNode) { @@ -116,6 +115,11 @@ class LazyDataObjectModification implements DataObjectModi } } + @Override + public T getDataBefore() { + return deserialize(domData.getDataBefore()); + } + @Override public T getDataAfter() { return deserialize(domData.getDataAfter()); @@ -149,8 +153,8 @@ class LazyDataObjectModification implements DataObjectModi @Override public Collection> getModifiedChildren() { - if(childNodesCache == null) { - childNodesCache = from(codec,domData.getChildNodes()); + if (childNodesCache == null) { + childNodesCache = from(codec, domData.getChildNodes()); } return childNodesCache; } @@ -191,7 +195,7 @@ class LazyDataObjectModification implements DataObjectModi } private T deserialize(final Optional> dataAfter) { - if(dataAfter.isPresent()) { + if (dataAfter.isPresent()) { return codec.deserialize(dataAfter.get()); } return null;