Record Class XmlConfig

java.lang.Object
java.lang.Record
net.luis.utils.io.data.xml.XmlConfig
Record Components:
strict - Whether to use strict xml parsing when reading
prettyPrint - Whether to pretty print the xml (write-only)
indent - The string to use for indentation (write-only)
allowAttributes - Whether to allow attributes in xml elements
simplifyValues - Whether to simplify xml values (write-only)
charset - The charset to use for reading and writing

public record XmlConfig(boolean strict, @WriteOnly boolean prettyPrint, @WriteOnly("prettyPrint") @NotNull String indent, boolean allowAttributes, @WriteOnly boolean simplifyValues, @NotNull Charset charset) extends Record
Configuration for reading and writing xml elements.
  • Field Details

    • strict

      private final boolean strict
      The field for the strict record component.
    • prettyPrint

      private final boolean prettyPrint
      The field for the prettyPrint record component.
    • indent

      @NotNull private final @NotNull String indent
      The field for the indent record component.
    • allowAttributes

      private final boolean allowAttributes
      The field for the allowAttributes record component.
    • simplifyValues

      private final boolean simplifyValues
      The field for the simplifyValues record component.
    • charset

      @NotNull private final @NotNull Charset charset
      The field for the charset record component.
    • DEFAULT

      public static final XmlConfig DEFAULT
      The default xml configuration.
      Strict: true
      Pretty print: true
      Indent: "\t"
      Allow attributes: true
      Simplify values: true
      Charset: UTF-8
  • Constructor Details

    • XmlConfig

      public XmlConfig(boolean strict, boolean prettyPrint, @NotNull @NotNull String indent, boolean allowAttributes, boolean simplifyValues, @NotNull @NotNull Charset charset)
      Constructs a new xml configuration.
      Parameters:
      strict - Whether to use strict xml parsing when reading
      prettyPrint - Whether to pretty print the xml (write-only)
      indent - The string to use for indentation (write-only)
      allowAttributes - Whether to allow attributes in xml elements
      simplifyValues - Whether to simplify xml values (write-only)
      charset - The charset to use for reading and writing
      Throws:
      NullPointerException - If the indent or charset is null
  • Method Details

    • 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 '=='.
      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.
    • strict

      public boolean strict()
      Returns the value of the strict record component.
      Returns:
      the value of the strict record component
    • prettyPrint

      public boolean prettyPrint()
      Returns the value of the prettyPrint record component.
      Returns:
      the value of the prettyPrint record component
    • indent

      @NotNull public @NotNull String indent()
      Returns the value of the indent record component.
      Returns:
      the value of the indent record component
    • allowAttributes

      public boolean allowAttributes()
      Returns the value of the allowAttributes record component.
      Returns:
      the value of the allowAttributes record component
    • simplifyValues

      public boolean simplifyValues()
      Returns the value of the simplifyValues record component.
      Returns:
      the value of the simplifyValues record component
    • charset

      @NotNull public @NotNull Charset charset()
      Returns the value of the charset record component.
      Returns:
      the value of the charset record component