@Override public QName getQName() { return QName.create(moduleQname, localName); } }
@Override public QName load(String key) { return QName.create(key); } }
@Override public QName load(String key) { return QName.create(key); } });
OpenDaylightExtensionsStatements(final QName statementName, final String argumentName, final Class<? extends DeclaredStatement<?>> declaredRepresentation, final Class<? extends EffectiveStatement<?, ?>> effectiveRepresentation) { this.statementName = statementName.intern(); this.argumentName = QName.create(statementName, argumentName); this.declaredRepresentation = requireNonNull(declaredRepresentation); this.effectiveRepresentation = requireNonNull(effectiveRepresentation); }
@Override public ImmutableSet<QName> load(final QNameModule key) { return ImmutableSet.of(QName.create(key, Origin.QNAME.getLocalName()).intern(), QName.create(key, AsPath.QNAME.getLocalName()).intern(), QName.create(key, CNextHop.QNAME.getLocalName()).intern(), QName.create(key, Communities.QNAME.getLocalName()).intern(), QName.create(key, ExtendedCommunities.QNAME.getLocalName()).intern()); } });
@Override public QNameWithPredicate build() { if (qnamePredicates.isEmpty() && moduleQname != null && localName != null) { return new SimpleQNameWithPredicate(QName.create(moduleQname, localName)); } final QNameWithPredicateImpl qNameWithPredicateImpl = new QNameWithPredicateImpl(moduleQname, localName, qnamePredicates); // QNameWithPredicateImpl has taken a copy qnamePredicates.clear(); return qNameWithPredicateImpl; }
/** * Creates new QName. * * @param namespace Namespace of QName or null if namespace is undefined. * @param revision Revision of namespace or null if revision is unspecified. * @param localName Local name part of QName. MUST NOT BE null. * @return Instance of QName */ public static @NonNull QName create(final URI namespace, final @Nullable Revision revision, final String localName) { return create(QNameModule.create(namespace, revision), localName); }
@Override protected final QName createQName(final String prefix, final String localName) { final Module module = moduleForPrefix(prefix); checkArgument(module != null, "Failed to lookup prefix %s", prefix); return QName.create(module.getQNameModule(), localName); } }
protected AbstractFlowspecL3vpnRIBSupport( final Class<? extends Routes> cazeClass, final Class<? extends DataObject> containerClass, final Class<? extends Route> listClass, final QName dstContainerClassQName, final Class<? extends AddressFamily> afiClass, final T flowspecNlriParser ) { super(cazeClass, containerClass, listClass, afiClass, FlowspecL3vpnSubsequentAddressFamily.class, dstContainerClassQName, flowspecNlriParser); this.routeDistinguisherNID = new NodeIdentifier(QName.create(routeQName(), "route-distinguisher").intern()); }
/** * Creates new QName. * * @param namespace Namespace of QName or null if namespace is undefined. * @param revision Revision of namespace. * @param localName Local name part of QName. MUST NOT BE null. * @return Instance of QName */ public static @NonNull QName create(final URI namespace, final Optional<Revision> revision, final String localName) { return create(QNameModule.create(namespace, revision), localName); }
/** * Creates new QName. * * @param namespace Namespace of QName, MUST NOT BE Null. * @param localName Local name part of QName. MUST NOT BE null. * @return A new QName * @throws NullPointerException If any of parameters is null. * @throws IllegalArgumentException If {@code namespace} is not valid URI. */ public static @NonNull QName create(final String namespace, final String localName) { return create(parseNamespace(namespace), localName); }
private static YangInstanceIdentifier.NodeIdentifierWithPredicates listId(final String listName, final String keyName, final Object keyValue) { return new YangInstanceIdentifier.NodeIdentifierWithPredicates(QName.create(CONTAINER_Q_NAME, listName), QName.create(CONTAINER_Q_NAME, keyName), keyValue); }
@Override public QName deserialize(final IdentityValuesDTO data) { final IdentityValue valueWithNamespace = data.getValuesWithNamespaces().get(0); final Module module = getModuleByNamespace(valueWithNamespace.getNamespace(), mountPoint); if (module == null) { logger.info("Module was not found for namespace {}", valueWithNamespace.getNamespace()); logger.info("Idenetityref will be translated as NULL for data - {}", String.valueOf(valueWithNamespace)); return null; } return QName.create(module.getNamespace(), module.getRevision(), valueWithNamespace.getValue()); }
private static YangInstanceIdentifier.AugmentationIdentifier autmentationId(final String... nodes) { final Set<QName> qNames = Arrays.stream(nodes) .map(node -> QName.create(CONTAINER_Q_NAME, node)) .collect(Collectors.toSet()); return new YangInstanceIdentifier.AugmentationIdentifier(qNames); }
/** * Creates new QName. * * @param namespace Namespace of QName or null if namespace is undefined. * @param revision Revision of namespace or null if revision is unspecified. * @param localName Local name part of QName. MUST NOT BE null. * @return Instance of QName */ public static @NonNull QName create(final String namespace, final String localName, final Revision revision) { return create(QNameModule.create(parseNamespace(namespace), revision), localName); }
@Override public Optional<StatementSupport<?, ?, ?>> getUnknownStatementDefinitionOf( final StatementDefinition yangStmtDef) { final QName baseQName = getStatementName(); final QName argumentName = yangStmtDef.getArgumentName(); return Optional.of(new ModelDefinedStatementSupport(new ModelDefinedStatementDefinition( QName.create(baseQName, yangStmtDef.getStatementName().getLocalName()), argumentName != null ? QName.create(baseQName, argumentName.getLocalName()) : null, yangStmtDef.isArgumentYinElement()))); } }
private static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createBIPathForTopology(final String name) { final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder builder = org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder(); builder .node(NetworkTopology.QNAME) .node(Topology.QNAME) .nodeWithKey(Topology.QNAME, QName.create(Topology.QNAME, "topology-id"), TopologyNetconf.QNAME.getLocalName()) .node(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node.QNAME) .nodeWithKey(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node.QNAME, QName.create(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node.QNAME, "node-id"), name); return builder.build(); }
static final SchemaPath typeEffectiveSchemaPath(final StmtContext<?, ?, ?> stmtCtx) { final SchemaPath path = stmtCtx.getSchemaPath().get(); final SchemaPath parent = path.getParent(); final QName parentQName = parent.getLastComponent(); Preconditions.checkArgument(parentQName != null, "Path %s has an empty parent", path); final QName qname = stmtCtx.getFromNamespace(QNameCacheNamespace.class, QName.create(parentQName, path.getLastComponent().getLocalName())); return parent.createChild(qname); } }
private ExtensionStatement(final ExtensionDefinition def) { statementName = def.getQName(); argumentName = def.getArgument() != null ? QName.create(statementName, def.getArgument()) : null; yinElement = def.isYinElement(); }
private static org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier createBIPath(final String name) { final org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.InstanceIdentifierBuilder builder = org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.builder(); builder.node(Nodes.QNAME).node(Node.QNAME).nodeWithKey(Node.QNAME, QName.create(Node.QNAME.getNamespace(), Node.QNAME.getRevision(), "id"), name); return builder.build(); }