import com.google.common.collect.Iterables;
import java.util.Map;
import org.opendaylight.yangtools.yang.common.QName;
-import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.NodeWithValue;
import org.opendaylight.yangtools.yang.data.api.schema.LeafSetEntryNode;
import org.opendaylight.yangtools.yang.data.impl.schema.Builders;
*
* @param <E> type of elements to be parsed
*/
-public abstract class LeafSetEntryNodeBaseParser<E> implements ExtensibleParser<YangInstanceIdentifier.NodeWithValue, E, LeafSetEntryNode<?>, LeafListSchemaNode> {
+public abstract class LeafSetEntryNodeBaseParser<E> implements ExtensibleParser<NodeWithValue, E, LeafSetEntryNode<?>, LeafListSchemaNode> {
- private final BuildingStrategy<YangInstanceIdentifier.NodeWithValue, LeafSetEntryNode<?>> buildingStrategy;
+ private final BuildingStrategy<NodeWithValue, LeafSetEntryNode<?>> buildingStrategy;
public LeafSetEntryNodeBaseParser() {
buildingStrategy = new SimpleLeafSetEntryBuildingStrategy();
}
- public LeafSetEntryNodeBaseParser(final BuildingStrategy<YangInstanceIdentifier.NodeWithValue, LeafSetEntryNode<?>> buildingStrategy) {
+ public LeafSetEntryNodeBaseParser(final BuildingStrategy<NodeWithValue, LeafSetEntryNode<?>> buildingStrategy) {
this.buildingStrategy = buildingStrategy;
}
@SuppressWarnings("unchecked")
@Override
- public final LeafSetEntryNode<?> parse(Iterable<E> elements, LeafListSchemaNode schema) {
+ public final LeafSetEntryNode<?> parse(final Iterable<E> elements, final LeafListSchemaNode schema) {
final int size = Iterables.size(elements);
Preconditions.checkArgument(size == 1, "Xml elements mapped to leaf node illegal count: %s", size);
final E e = elements.iterator().next();
Object value = parseLeafListEntry(e,schema);
- NormalizedNodeAttrBuilder<YangInstanceIdentifier.NodeWithValue, Object, LeafSetEntryNode<Object>> leafEntryBuilder = Builders
+ NormalizedNodeAttrBuilder<NodeWithValue, Object, LeafSetEntryNode<Object>> leafEntryBuilder = Builders
.leafSetEntryBuilder(schema);
leafEntryBuilder.withAttributes(getAttributes(e));
leafEntryBuilder.withValue(value);
*/
protected abstract Map<QName, String> getAttributes(E e);
- public static class SimpleLeafSetEntryBuildingStrategy implements BuildingStrategy<YangInstanceIdentifier.NodeWithValue, LeafSetEntryNode<?>> {
+ public static class SimpleLeafSetEntryBuildingStrategy implements BuildingStrategy<NodeWithValue, LeafSetEntryNode<?>> {
@Override
public LeafSetEntryNode<?> build(final NormalizedNodeBuilder<NodeWithValue, ?, LeafSetEntryNode<?>> builder) {