use of org.opendaylight.yangtools.yang.common.BiMapYangNamespaceContext in project yangtools by opendaylight.
the class ModuleNameNamespaceContext method toBiMap.
/**
* Convert this object to an equivalent {@link BiMapYangNamespaceContext}.
*
* @return A BiMapYangNamespaceContext.
*/
public BiMapYangNamespaceContext toBiMap() {
final Builder<String, QNameModule> builder = ImmutableBiMap.builder();
for (ModuleEffectiveStatement module : getEffectiveModelContext().getModuleStatements().values()) {
final String name = module.argument().getLocalName();
builder.put(name, findNamespaceForPrefix(name).get());
}
return new BiMapYangNamespaceContext(builder.build());
}
Aggregations