java.lang.Object
java.lang.Record
net.luis.utils.io.data.xml.XmlConfig
- Record Components:
strict
- Whether to use strict xml parsing when readingprettyPrint
- Whether to pretty print the xml (write-only)indent
- The string to use for indentation (write-only)allowAttributes
- Whether to allow attributes in xml elementssimplifyValues
- 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 Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
The field for theallowAttributes
record component.private final @NotNull Charset
The field for thecharset
record component.static final XmlConfig
The default xml configuration.
Strict: true
Pretty print: true
Indent: "\t"
Allow attributes: true
Simplify values: true
Charset: UTF-8private final @NotNull String
The field for theindent
record component.private final boolean
The field for theprettyPrint
record component.private final boolean
The field for thesimplifyValues
record component.private final boolean
The field for thestrict
record component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returns the value of theallowAttributes
record component.@NotNull Charset
charset()
Returns the value of thecharset
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull String
indent()
Returns the value of theindent
record component.boolean
Returns the value of theprettyPrint
record component.boolean
Returns the value of thesimplifyValues
record component.boolean
strict()
Returns the value of thestrict
record component.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
strict
private final boolean strictThe field for thestrict
record component. -
prettyPrint
private final boolean prettyPrintThe field for theprettyPrint
record component. -
indent
The field for theindent
record component. -
allowAttributes
private final boolean allowAttributesThe field for theallowAttributes
record component. -
simplifyValues
private final boolean simplifyValuesThe field for thesimplifyValues
record component. -
charset
The field for thecharset
record component. -
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 readingprettyPrint
- Whether to pretty print the xml (write-only)indent
- The string to use for indentation (write-only)allowAttributes
- Whether to allow attributes in xml elementssimplifyValues
- 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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
strict
public boolean strict()Returns the value of thestrict
record component.- Returns:
- the value of the
strict
record component
-
prettyPrint
public boolean prettyPrint()Returns the value of theprettyPrint
record component.- Returns:
- the value of the
prettyPrint
record component
-
indent
Returns the value of theindent
record component.- Returns:
- the value of the
indent
record component
-
allowAttributes
public boolean allowAttributes()Returns the value of theallowAttributes
record component.- Returns:
- the value of the
allowAttributes
record component
-
simplifyValues
public boolean simplifyValues()Returns the value of thesimplifyValues
record component.- Returns:
- the value of the
simplifyValues
record component
-
charset
Returns the value of thecharset
record component.- Returns:
- the value of the
charset
record component
-