Class ReportNodeNoOp

java.lang.Object
com.powsybl.commons.report.ReportNodeNoOp
All Implemented Interfaces:
ReportNode

public class ReportNodeNoOp extends Object implements ReportNode
A default no-op implementation
Author:
Florian Dupuy <florian.dupuy at rte-france.com>
  • Constructor Details

    • ReportNodeNoOp

      public ReportNodeNoOp()
  • Method Details

    • newReportNode

      public ReportNodeAdder newReportNode()
      Description copied from interface: ReportNode
      Create a new adder to create a ReportNode child.
      Specified by:
      newReportNode in interface ReportNode
      Returns:
      the created ReportNodeAdder
    • include

      public void include(ReportNode reportRoot)
      Description copied from interface: ReportNode
      Add a ReportNode as a child of current ReportNode.
      Specified by:
      include in interface ReportNode
      Parameters:
      reportRoot - the ReportNode to add, it needs to be a root ReportNode
    • getMessageKey

      public String getMessageKey()
      Description copied from interface: ReportNode
      Get the message key for current node. Note that each key needs to correspond to a unique message template. This allows to build up a dictionary of message templates indexed by their key.
      Specified by:
      getMessageKey in interface ReportNode
      Returns:
      the key
    • getMessageTemplate

      public String getMessageTemplate()
      Description copied from interface: ReportNode
      Get the message template for current node.
      Specified by:
      getMessageTemplate in interface ReportNode
      Returns:
      the message template
    • getMessage

      public String getMessage()
      Description copied from interface: ReportNode
      Get the message of current node, replacing ${key} references in the message template with the corresponding values, either contained in current node or in one of its parents.
      Specified by:
      getMessage in interface ReportNode
      Returns:
      the message
    • getValues

      public Map<String,TypedValue> getValues()
      Description copied from interface: ReportNode
      Get the values which belong to current node (does not include the inherited values)
      Specified by:
      getValues in interface ReportNode
      Returns:
      the values unmodifiable map
    • getValue

      public Optional<TypedValue> getValue(String valueKey)
      Description copied from interface: ReportNode
      Get the value corresponding to the given key
      Specified by:
      getValue in interface ReportNode
      Parameters:
      valueKey - the key to request
      Returns:
      the value
    • getChildren

      public List<ReportNode> getChildren()
      Description copied from interface: ReportNode
      Get the children of current node
      Specified by:
      getChildren in interface ReportNode
      Returns:
      the children nodes
    • writeJson

      public void writeJson(com.fasterxml.jackson.core.JsonGenerator generator) throws IOException
      Description copied from interface: ReportNode
      Serialize the current report node
      Specified by:
      writeJson in interface ReportNode
      Parameters:
      generator - the jsonGenerator to use for serialization
      Throws:
      IOException
    • print

      public void print(Writer writer) throws IOException
      Description copied from interface: ReportNode
      Print to given writer the current report node and its descendants
      Specified by:
      print in interface ReportNode
      Parameters:
      writer - the writer to write to
      Throws:
      IOException