Record Class PrintConfiguration

java.lang.Object
java.lang.Record
org.tentackle.model.print.PrintConfiguration
Record Components:
compact - compact output, i.e., omit implicit configuration
asComment - print as a comment block
useVariables - use variables in the printed model
modelDefaults - optional model defaults
optionAnnotations - annotations that should be printed as attribute options
columnGap - minimum number of spaces between columns in the attribute section

public record PrintConfiguration(boolean compact, boolean asComment, boolean useVariables, ModelDefaults modelDefaults, List<String> optionAnnotations, int columnGap) extends Record
Holds parameters to configure the generated output.
  • Constructor Details

    • PrintConfiguration

      public PrintConfiguration(boolean compact, boolean asComment, boolean useVariables, ModelDefaults modelDefaults, List<String> optionAnnotations, int columnGap)
      Creates an instance of a PrintConfiguration record class.
      Parameters:
      compact - the value for the compact record component
      asComment - the value for the asComment record component
      useVariables - the value for the useVariables record component
      modelDefaults - the value for the modelDefaults record component
      optionAnnotations - the value for the optionAnnotations record component
      columnGap - the value for the columnGap record component
  • Method Details

    • isOptionAnnotation

      public boolean isOptionAnnotation(String annotation)
      Returns whether the given annotation should be printed as an attribute option.

      optionAnnotations is a list of annotations that should be printed as attribute options.
      A comma separates multiple annotations.
      If the annotation ends with a |, it matches only annotations without parameters.
      The special annotation @* matches all annotations and @*| matches all annotations without parameters.

      Example: @NotNull|, @NotZero

      Parameters:
      annotation - the annotation string
      Returns:
      true to print as an attribute option
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • compact

      public boolean compact()
      Returns the value of the compact record component.
      Returns:
      the value of the compact record component
    • asComment

      public boolean asComment()
      Returns the value of the asComment record component.
      Returns:
      the value of the asComment record component
    • useVariables

      public boolean useVariables()
      Returns the value of the useVariables record component.
      Returns:
      the value of the useVariables record component
    • modelDefaults

      public ModelDefaults modelDefaults()
      Returns the value of the modelDefaults record component.
      Returns:
      the value of the modelDefaults record component
    • optionAnnotations

      public List<String> optionAnnotations()
      Returns the value of the optionAnnotations record component.
      Returns:
      the value of the optionAnnotations record component
    • columnGap

      public int columnGap()
      Returns the value of the columnGap record component.
      Returns:
      the value of the columnGap record component