src/main/java/com/theoryinpractise/halbuilder5/NamespaceManager.java
public NamespaceManager withNamespace(String namespace, String href) {
    if (namespaces.containsKey(namespace)) {
      throw new RepresentationException(
          format("Duplicate namespace '%s' found for representation factory", namespace));
    }
    if (!href.contains("{rel}")) {
      throw new RepresentationException(
          format("Namespace '%s' does not include {rel} URI template argument.", namespace));
    }
    return new NamespaceManager(namespaces.put(namespace, href));
  }
public NamespaceManager withNamespace(String namespace, String href) {
    if (namespaces.containsKey(namespace)) {
      throw new RepresentationException(
          format("Duplicate namespace '%s' found for representation factory", namespace));
    }
    if (!href.contains("{rel}")) {
      throw new RepresentationException(
          format("Namespace '%s' does not include {rel} URI template argument.", namespace));
    }
    return new NamespaceManager(namespaces.put(namespace, href));
  }
public NamespaceManager withNamespace ( String namespace , String href ) { if ( namespaces . containsKey ( namespace ) ) { throw new RepresentationException ( format ( "Duplicate namespace '%s' found for representation factory" , namespace ) ) ; } if ( ! href . contains ( "{rel}" ) ) { throw new RepresentationException ( format ( "Namespace '%s' does not include {rel} URI template argument." , namespace ) ) ; } return new NamespaceManager ( namespaces . put ( namespace , href ) ) ; }
Update the list of declared namespaces with a new namespace.

@param namespace Namespace curie identifier
@param href Namesapce URL
@return A new instance of the namespace manager with the additional namespace.
Update the list of declared namespaces with a new namespace .