Package com.tonic.analysis.graph.print
Class GraphPrinterConfig.Builder
- java.lang.Object
-
- com.tonic.analysis.graph.print.GraphPrinterConfig.Builder
-
- Enclosing class:
- GraphPrinterConfig
public static class GraphPrinterConfig.Builder extends Object
Mutable accumulator for the printer settings, seeded with the normal defaults.
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GraphPrinterConfigbuild()Builds a config from the values set so far.GraphPrinterConfig.BuildergroupByMethod(boolean groupByMethod)Sets whether nodes are grouped under their owning procedure rather than listed flat.GraphPrinterConfig.BuilderindentString(String indentString)Sets the text emitted for one level of indentation.GraphPrinterConfig.BuildermaxLabelLength(int maxLabelLength)Sets the character budget a label gets before truncation applies.GraphPrinterConfig.BuildermaxNodesPerMethod(int maxNodesPerMethod)Sets how many nodes are printed per method before the rest are elided.GraphPrinterConfig.BuildershowEdgeLabels(boolean showEdgeLabels)Sets whether an edge carries its type name inline.GraphPrinterConfig.BuildershowLineNumbers(boolean showLineNumbers)Sets whether source line numbers are printed with nodes.GraphPrinterConfig.BuildershowNodeIds(boolean showNodeIds)Sets whether each node is prefixed with its numeric id.GraphPrinterConfig.BuildershowProperties(boolean showProperties)Sets whether per-node detail lines are printed under each node.GraphPrinterConfig.BuildershowStatistics(boolean showStatistics)Sets whether a trailing node and edge count section is printed.GraphPrinterConfig.BuildertruncateLongLabels(boolean truncateLongLabels)Sets whether labels longer than the maximum length are cut short.GraphPrinterConfig.Builderverbosity(Verbosity verbosity)Sets the detail level printers compare against when deciding what to emit.
-
-
-
Method Detail
-
verbosity
public GraphPrinterConfig.Builder verbosity(Verbosity verbosity)
Sets the detail level printers compare against when deciding what to emit.- Parameters:
verbosity- the detail level- Returns:
- this builder
-
showNodeIds
public GraphPrinterConfig.Builder showNodeIds(boolean showNodeIds)
Sets whether each node is prefixed with its numeric id.- Parameters:
showNodeIds- true to print ids- Returns:
- this builder
-
showEdgeLabels
public GraphPrinterConfig.Builder showEdgeLabels(boolean showEdgeLabels)
Sets whether an edge carries its type name inline.- Parameters:
showEdgeLabels- true to label edges- Returns:
- this builder
-
showProperties
public GraphPrinterConfig.Builder showProperties(boolean showProperties)
Sets whether per-node detail lines are printed under each node.- Parameters:
showProperties- true to print properties- Returns:
- this builder
-
showLineNumbers
public GraphPrinterConfig.Builder showLineNumbers(boolean showLineNumbers)
Sets whether source line numbers are printed with nodes.- Parameters:
showLineNumbers- true to print line numbers- Returns:
- this builder
-
groupByMethod
public GraphPrinterConfig.Builder groupByMethod(boolean groupByMethod)
Sets whether nodes are grouped under their owning procedure rather than listed flat.- Parameters:
groupByMethod- true to group by method- Returns:
- this builder
-
showStatistics
public GraphPrinterConfig.Builder showStatistics(boolean showStatistics)
Sets whether a trailing node and edge count section is printed.- Parameters:
showStatistics- true to print statistics- Returns:
- this builder
-
indentString
public GraphPrinterConfig.Builder indentString(String indentString)
Sets the text emitted for one level of indentation.- Parameters:
indentString- the indent unit- Returns:
- this builder
-
maxNodesPerMethod
public GraphPrinterConfig.Builder maxNodesPerMethod(int maxNodesPerMethod)
Sets how many nodes are printed per method before the rest are elided.- Parameters:
maxNodesPerMethod- the node budget- Returns:
- this builder
-
truncateLongLabels
public GraphPrinterConfig.Builder truncateLongLabels(boolean truncateLongLabels)
Sets whether labels longer than the maximum length are cut short.- Parameters:
truncateLongLabels- true to truncate- Returns:
- this builder
-
maxLabelLength
public GraphPrinterConfig.Builder maxLabelLength(int maxLabelLength)
Sets the character budget a label gets before truncation applies.- Parameters:
maxLabelLength- the cut-off length- Returns:
- this builder
-
build
public GraphPrinterConfig build()
Builds a config from the values set so far.- Returns:
- the immutable config
-
-