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 booleanThe field for theallowAttributesrecord component.private final @NotNull CharsetThe field for thecharsetrecord component.static final XmlConfigThe default xml configuration.
Strict: true
Pretty print: true
Indent: "\t"
Allow attributes: true
Simplify values: true
Charset: UTF-8private final @NotNull StringThe field for theindentrecord component.private final booleanThe field for theprettyPrintrecord component.private final booleanThe field for thesimplifyValuesrecord component.private final booleanThe field for thestrictrecord component. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theallowAttributesrecord component.@NotNull Charsetcharset()Returns the value of thecharsetrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull Stringindent()Returns the value of theindentrecord component.booleanReturns the value of theprettyPrintrecord component.booleanReturns the value of thesimplifyValuesrecord component.booleanstrict()Returns the value of thestrictrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
strict
private final boolean strictThe field for thestrictrecord component. -
prettyPrint
private final boolean prettyPrintThe field for theprettyPrintrecord component. -
indent
The field for theindentrecord component. -
allowAttributes
private final boolean allowAttributesThe field for theallowAttributesrecord component. -
simplifyValues
private final boolean simplifyValuesThe field for thesimplifyValuesrecord component. -
charset
The field for thecharsetrecord 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 thestrictrecord component.- Returns:
- the value of the
strictrecord component
-
prettyPrint
public boolean prettyPrint()Returns the value of theprettyPrintrecord component.- Returns:
- the value of the
prettyPrintrecord component
-
indent
Returns the value of theindentrecord component.- Returns:
- the value of the
indentrecord component
-
allowAttributes
public boolean allowAttributes()Returns the value of theallowAttributesrecord component.- Returns:
- the value of the
allowAttributesrecord component
-
simplifyValues
public boolean simplifyValues()Returns the value of thesimplifyValuesrecord component.- Returns:
- the value of the
simplifyValuesrecord component
-
charset
Returns the value of thecharsetrecord component.- Returns:
- the value of the
charsetrecord component
-