Class IdentifierIssuer


  • public class IdentifierIssuer
    extends java.lang.Object
    An issuer of counted identifiers to map identifiers from one naming scheme to another.
    • Constructor Summary

      Constructors 
      Constructor Description
      IdentifierIssuer​(java.lang.String prefix)
      Create a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void assign​(IdentifierIssuer other)
      Create a mapping in an other issuer for all identifiers issued by this, in the same order that they were issued by this.
      IdentifierIssuer copy()
      Create a copy of this issuer.
      com.apicatalog.rdf.RdfResource getId​(com.apicatalog.rdf.RdfResource id)
      Get or allocate a new ID for the specified old ID.
      com.apicatalog.rdf.RdfResource getIfExists​(com.apicatalog.rdf.RdfResource value, java.util.concurrent.atomic.AtomicBoolean flag)
      Get the resource replaced by a proper blank identifier if appropriate.
      boolean hasId​(com.apicatalog.rdf.RdfResource id)
      Does an old ID have an allocated new ID?.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IdentifierIssuer

        public IdentifierIssuer​(java.lang.String prefix)
        Create a new instance.
        Parameters:
        prefix - the prefix for new identifiers.
    • Method Detail

      • assign

        public void assign​(IdentifierIssuer other)
        Create a mapping in an other issuer for all identifiers issued by this, in the same order that they were issued by this.
        Parameters:
        other - the other identifier issuer.
      • copy

        public IdentifierIssuer copy()
        Create a copy of this issuer.
        Returns:
        the issuer to copy
      • getId

        public com.apicatalog.rdf.RdfResource getId​(com.apicatalog.rdf.RdfResource id)
        Get or allocate a new ID for the specified old ID.
        Parameters:
        id - the old ID
        Returns:
        the new ID
      • getIfExists

        public com.apicatalog.rdf.RdfResource getIfExists​(com.apicatalog.rdf.RdfResource value,
                                                          java.util.concurrent.atomic.AtomicBoolean flag)
        Get the resource replaced by a proper blank identifier if appropriate.
        Parameters:
        value - the resource to check
        flag - set to true if a replacement happens
        Returns:
        the value or the replaced value
      • hasId

        public boolean hasId​(com.apicatalog.rdf.RdfResource id)
        Does an old ID have an allocated new ID?.
        Parameters:
        id - the old ID
        Returns:
        true of a new ID has been allocated for this old ID.