X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-dom-broker%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fdom%2Fstore%2Fimpl%2FStoreUtils.java;h=02c2a4fa06042e2984745183262a7d053411157a;hp=df58d62dd47662a7da382f2232b8067a337c7118;hb=08217531fbe76dbcc429c71d593894fc211e50aa;hpb=76b4cab3979151c4c599761301deab0766e0bbf1 diff --git a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/StoreUtils.java b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/StoreUtils.java index df58d62dd4..02c2a4fa06 100644 --- a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/StoreUtils.java +++ b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/StoreUtils.java @@ -45,6 +45,11 @@ public final class StoreUtils { return new InitialDataChangeEvent(path, data.getData()); } + @SuppressWarnings({ "unchecked", "rawtypes" }) + public static Function, V> identifierExtractor() { + return (Function) EXTRACT_IDENTIFIER; + } + private static final class InitialDataChangeEvent implements AsyncDataChangeEvent> { @@ -88,30 +93,25 @@ public final class StoreUtils { } - @SuppressWarnings({ "unchecked", "rawtypes" }) - public static Function,V> identifierExtractor() { - return (Function) EXTRACT_IDENTIFIER; - } - public static Set toIdentifierSet(final Iterable> children) { - return FluentIterable.from(children).transform(StoreUtils.identifierExtractor()).toSet(); + return FluentIterable.from(children).transform(StoreUtils. identifierExtractor()).toSet(); } public static String toStringTree(final StoreMetadataNode metaNode) { StringBuilder builder = new StringBuilder(); - toStringTree(builder, metaNode,0); + toStringTree(builder, metaNode, 0); return builder.toString(); } - private static void toStringTree(final StringBuilder builder, final StoreMetadataNode metaNode,final int offset) { + private static void toStringTree(final StringBuilder builder, final StoreMetadataNode metaNode, final int offset) { String prefix = Strings.repeat(" ", offset); builder.append(prefix).append(toStringTree(metaNode.getIdentifier())); NormalizedNode dataNode = metaNode.getData(); - if(dataNode instanceof NormalizedNodeContainer) { + if (dataNode instanceof NormalizedNodeContainer) { builder.append(" {").append("\n"); - for(StoreMetadataNode child : metaNode.getChildren()) { - toStringTree(builder, child, offset+4); + for (StoreMetadataNode child : metaNode.getChildren()) { + toStringTree(builder, child, offset + 4); } builder.append(prefix).append("}"); } else { @@ -121,7 +121,7 @@ public final class StoreUtils { } private static String toStringTree(final PathArgument identifier) { - if( identifier instanceof NodeIdentifierWithPredicates) { + if (identifier instanceof NodeIdentifierWithPredicates) { StringBuilder builder = new StringBuilder(); builder.append(identifier.getNodeType().getLocalName()); builder.append(((NodeIdentifierWithPredicates) identifier).getKeyValues().values());