Class UniqueNamer

java.lang.Object
com.github.jsonldjava.core.UniqueNamer

class UniqueNamer extends Object
  • Field Details

    • prefix

      private final String prefix
    • counter

      private int counter
    • existing

      private Map<String,String> existing
  • Constructor Details

    • UniqueNamer

      public UniqueNamer(String prefix)
      Creates a new UniqueNamer. A UniqueNamer issues unique names, keeping track of any previously issued names.
      Parameters:
      prefix - the prefix to use ('<prefix><counter>').
  • Method Details

    • clone

      public UniqueNamer clone()
      Copies this UniqueNamer.
      Overrides:
      clone in class Object
      Returns:
      a copy of this UniqueNamer.
    • getName

      public String getName(String oldName)
      Gets the new name for the given old name, where if no old name is given a new name will be generated.
      Parameters:
      oldName - the old name to get the new name for.
      Returns:
      the new name.
    • getName

      public String getName()
    • isNamed

      public Boolean isNamed(String oldName)
    • existing

      public Map<String,String> existing()