Code Review
/
controller.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge "Removed BundleContext from Broker.register{Consumer,Provider} (Part 2)"
[controller.git]
/
opendaylight
/
md-sal
/
sal-dom-broker
/
src
/
main
/
java
/
org
/
opendaylight
/
controller
/
sal
/
dom
/
broker
/
util
/
YangSchemaUtils.java
diff --git
a/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/YangSchemaUtils.java
b/opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/YangSchemaUtils.java
index a478aaac97779b0499eb684797e8cbc220d8df24..cd1a792d677cd7e4cbaead37b652cd2e8d9a4f21 100644
(file)
--- a/
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/YangSchemaUtils.java
+++ b/
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/sal/dom/broker/util/YangSchemaUtils.java
@@
-7,6
+7,11
@@
*/
package org.opendaylight.controller.sal.dom.broker.util;
*/
package org.opendaylight.controller.sal.dom.broker.util;
+import static com.google.common.base.Preconditions.checkArgument;
+import static com.google.common.base.Preconditions.checkState;
+
+import com.google.common.base.Function;
+import com.google.common.collect.FluentIterable;
import java.util.Iterator;
import java.util.List;
import java.util.Iterator;
import java.util.List;
@@
-32,17
+37,12
@@
import org.opendaylight.yangtools.yang.model.api.TypeDefinition;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.UsesNode;
import org.opendaylight.yangtools.yang.model.api.UnknownSchemaNode;
import org.opendaylight.yangtools.yang.model.api.UsesNode;
-import static com.google.common.base.Preconditions.*;
-
-import com.google.common.base.Function;
-import com.google.common.collect.FluentIterable;
-
-public class YangSchemaUtils {
+public final class YangSchemaUtils {
private static final Function<PathArgument, QName> QNAME_FROM_PATH_ARGUMENT = new Function<PathArgument, QName>(){
@Override
private static final Function<PathArgument, QName> QNAME_FROM_PATH_ARGUMENT = new Function<PathArgument, QName>(){
@Override
- public QName apply(PathArgument input) {
+ public QName apply(
final
PathArgument input) {
if(input == null) {
return null;
}
if(input == null) {
return null;
}
@@
-50,18
+50,17
@@
public class YangSchemaUtils {
}
};
}
};
- private
YangSchemaUtils() {
+ private YangSchemaUtils() {
throw new UnsupportedOperationException("Utility class.");
}
throw new UnsupportedOperationException("Utility class.");
}
-
- public static DataSchemaNode getSchemaNode(SchemaContext schema,InstanceIdentifier path) {
+ public static DataSchemaNode getSchemaNode(final SchemaContext schema,final InstanceIdentifier path) {
checkArgument(schema != null,"YANG Schema must not be null.");
checkArgument(path != null,"Path must not be null.");
checkArgument(schema != null,"YANG Schema must not be null.");
checkArgument(path != null,"Path must not be null.");
- return getSchemaNode(schema, FluentIterable.from(path.getPath()).transform(QNAME_FROM_PATH_ARGUMENT));
+ return getSchemaNode(schema, FluentIterable.from(path.getPath
Arguments
()).transform(QNAME_FROM_PATH_ARGUMENT));
}
}
- public static DataSchemaNode getSchemaNode(
SchemaContext schema,
Iterable<QName> path) {
+ public static DataSchemaNode getSchemaNode(
final SchemaContext schema,final
Iterable<QName> path) {
checkArgument(schema != null,"YANG Schema must not be null.");
checkArgument(path != null,"Path must not be null.");
if(!path.iterator().hasNext()){
checkArgument(schema != null,"YANG Schema must not be null.");
checkArgument(path != null,"Path must not be null.");
if(!path.iterator().hasNext()){
@@
-92,9
+91,8
@@
public class YangSchemaUtils {
return (DataSchemaNode) previous;
}
return (DataSchemaNode) previous;
}
- private static DataSchemaNode searchInChoices(DataNodeContainer node, QName arg) {
- Set<DataSchemaNode> children = node.getChildNodes();
- for (DataSchemaNode child : children) {
+ private static DataSchemaNode searchInChoices(final DataNodeContainer node, final QName arg) {
+ for (DataSchemaNode child : node.getChildNodes()) {
if (child instanceof ChoiceNode) {
ChoiceNode choiceNode = (ChoiceNode) child;
DataSchemaNode potential = searchInCases(choiceNode, arg);
if (child instanceof ChoiceNode) {
ChoiceNode choiceNode = (ChoiceNode) child;
DataSchemaNode potential = searchInCases(choiceNode, arg);
@@
-106,7
+104,7
@@
public class YangSchemaUtils {
return null;
}
return null;
}
- private static DataSchemaNode searchInCases(
ChoiceNode choiceNode,
QName arg) {
+ private static DataSchemaNode searchInCases(
final ChoiceNode choiceNode, final
QName arg) {
Set<ChoiceCaseNode> cases = choiceNode.getCases();
for (ChoiceCaseNode caseNode : cases) {
DataSchemaNode node = caseNode.getDataChildByName(arg);
Set<ChoiceCaseNode> cases = choiceNode.getCases();
for (ChoiceCaseNode caseNode : cases) {
DataSchemaNode node = caseNode.getDataChildByName(arg);
@@
-117,13
+115,13
@@
public class YangSchemaUtils {
return null;
}
return null;
}
- private static ContainerSchemaNode toRootDataNode(SchemaContext schema) {
+ private static ContainerSchemaNode toRootDataNode(
final
SchemaContext schema) {
return new NetconfDataRootNode(schema);
}
private static final class NetconfDataRootNode implements ContainerSchemaNode {
return new NetconfDataRootNode(schema);
}
private static final class NetconfDataRootNode implements ContainerSchemaNode {
- public NetconfDataRootNode(SchemaContext schema) {
+ public NetconfDataRootNode(
final
SchemaContext schema) {
// TODO Auto-generated constructor stub
}
// TODO Auto-generated constructor stub
}
@@
-146,13
+144,13
@@
public class YangSchemaUtils {
}
@Override
}
@Override
- public DataSchemaNode getDataChildByName(QName name) {
+ public DataSchemaNode getDataChildByName(
final
QName name) {
// TODO Auto-generated method stub
return null;
}
@Override
// TODO Auto-generated method stub
return null;
}
@Override
- public DataSchemaNode getDataChildByName(String name) {
+ public DataSchemaNode getDataChildByName(
final
String name) {
// TODO Auto-generated method stub
return null;
}
// TODO Auto-generated method stub
return null;
}