QName { public static QName adaptName(final @NotNull NamespaceMapping mapping, final @NotNull Type type, final @NotNull Name name) { return new QName(type, result1(mapping::getPrefix) .apply(name.getNamespaceURI()).toOptional().orElse(null), name.getLocalName(), name.getNamespaceURI()); } QName(final @NotNull Type type,
                 final @Nullable String prefix,
                 final @NotNull String localName,
                 final @Nullable String uri); static QName parseQName(final @NotNull NamespaceMapping mapping,
                                   final @NotNull Type type,
                                   final @NotNull String qName); static QName adaptName(final @NotNull NamespaceMapping mapping,
                                  final @NotNull Type type,
                                  final @NotNull Name name); Type getType(); String getPrefix(); String getLocalName(); String getUri(); @Override String toString(); String toExpandedForm(); @Override boolean equals(final Object o); @Override int hashCode();  }
@Test public void testAdaptName() throws Exception { final NamePathResolver resolver = new DefaultNamePathResolver(JsonCnd.BUILTIN_MAPPINGS); final QName ntPrefixName = QName.adaptName(JsonCnd.BUILTIN_MAPPINGS, QName.Type.NODETYPE, resolver.getQName("nt:aType")); final QName ntUriName = QName.adaptName(JsonCnd.BUILTIN_MAPPINGS, QName.Type.NODETYPE, resolver.getQName("{" + NamespaceRegistry.NAMESPACE_NT + "}" + "aType")); assertEquals("adapt equals", ntPrefixName, ntUriName); }