Interface IdentifiedObjectBuilder<T extends nz.org.riskscape.engine.Identified>

All Known Implementing Classes:
BookmarkFactory, IdentifiedObjectBuilder.Base, IniFileFunctionBuilder, IniFileModelBuilder2, IniFileParameterBuilder, IniFileTypeBuilder

public interface IdentifiedObjectBuilder<T extends nz.org.riskscape.engine.Identified>

Builds an Identified RiskScape item (bookmark, type, model, etc) from an INI file section.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    IdentifiedObjectBuilder.Base<T extends nz.org.riskscape.engine.Identified>
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    addToProject(nz.org.riskscape.engine.Project project, String id, nz.org.riskscape.config.ConfigSection section)
    Lazily adds the Identified item in the given INI section to the project.
    nz.org.riskscape.problem.ResultOrProblems<T>
    build(String id, nz.org.riskscape.config.ConfigSection section)
    Builds the item based on the given INI section.
     
     
  • Method Details

    • getIdentifiedClass

      Class<T> getIdentifiedClass()
      Returns:
      the class of the Identified object being built
    • getKeyword

      String getKeyword()
      Returns:
      the keyword to look for in standalone INI file sections, e.g. "bookmark" in [bookmark foo] bar = baz
    • build

      nz.org.riskscape.problem.ResultOrProblems<T> build(String id, nz.org.riskscape.config.ConfigSection section)

      Builds the item based on the given INI section.

      Returns:
      the item successfully built, or any problems that occurred.
    • addToProject

      default void addToProject(nz.org.riskscape.engine.Project project, String id, nz.org.riskscape.config.ConfigSection section)

      Lazily adds the Identified item in the given INI section to the project. The item will be built as needed, when accessed from the project collection.