Class SequentialIntegerIdGeneratorStrategy

java.lang.Object
com.structurizr.model.SequentialIntegerIdGeneratorStrategy
All Implemented Interfaces:
IdGenerator

public class SequentialIntegerIdGeneratorStrategy
extends java.lang.Object
implements IdGenerator
An ID generator that simply uses a sequential number when generating IDs for model elements and relationships. This is the default ID generator.
  • Constructor Summary

    Constructors 
    Constructor Description
    SequentialIntegerIdGeneratorStrategy()  
  • Method Summary

    Modifier and Type Method Description
    void found​(java.lang.String id)
    Called when loading/deserializing a model, to indicate that the specified ID has been found (and shouldn't be reused when generating new IDs).
    java.lang.String generateId​(Element element)
    Generates an ID for the specified model element.
    java.lang.String generateId​(Relationship relationship)
    Generates an ID for the specified model relationship.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • generateId

      public java.lang.String generateId​(Element element)
      Description copied from interface: IdGenerator
      Generates an ID for the specified model element.
      Specified by:
      generateId in interface IdGenerator
      Parameters:
      element - an Element instance
      Returns:
      the ID, as a String
    • generateId

      public java.lang.String generateId​(Relationship relationship)
      Description copied from interface: IdGenerator
      Generates an ID for the specified model relationship.
      Specified by:
      generateId in interface IdGenerator
      Parameters:
      relationship - a Relationship instance
      Returns:
      the ID, as a String
    • found

      public void found​(java.lang.String id)
      Description copied from interface: IdGenerator
      Called when loading/deserializing a model, to indicate that the specified ID has been found (and shouldn't be reused when generating new IDs).
      Specified by:
      found in interface IdGenerator
      Parameters:
      id - the ID that has been found