Class RenderedProblem

java.lang.Object
nz.org.riskscape.engine.i18n.RenderedProblem

public class RenderedProblem extends Object

Returned from Messages.renderProblem(Problem, java.util.Locale) to translate a problem while maintaining its tree structure. This should allow UIs to present it appropriately without having to translate it all individually.

  • Field Details

    • message

      public final String message

      The translated message for the source problem

    • source

      public final Problem source

      The thing that caused all the problems

    • indentLevel

      public final int indentLevel

      The number of ancestors this problem has

    • children

      public final List<RenderedProblem> children

      A list of RenderedProblems for each child in source

  • Constructor Details

  • Method Details

    • toList

      public List<RenderedProblem> toList()

      Convert this RenderedProblem in to a list, as per a depth-first search of this RenderedProblem

      Returns:
    • toString

      public String toString(Consumer<RenderedProblem.ToStringOptions> customize)

      Returns a line separated, indented version of this problem and its children

    • toString

      public String toString(RenderedProblem.ToStringOptions options)
    • toString

      public String toString()

      Returns a line separated, indented version of this problem and its children

      Overrides:
      toString in class Object
    • getMessage

      public String getMessage()

      The translated message for the source problem

    • getSource

      public Problem getSource()

      The thing that caused all the problems

    • getIndentLevel

      public int getIndentLevel()

      The number of ancestors this problem has

    • getChildren

      public List<RenderedProblem> getChildren()

      A list of RenderedProblems for each child in source

    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object