java.lang.Object
java.lang.Record
net.luis.utils.io.data.xml.XmlDeclaration
- Record Components:
version
- The version of the xml documentencoding
- The encoding of the xml documentstandalone
- Whether the xml document is standalone or not
public record XmlDeclaration(@NotNull Version version, @NotNull Charset encoding, boolean standalone)
extends Record
Represents an xml declaration.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NotNull Charset
The field for theencoding
record component.private final boolean
The field for thestandalone
record component.private final @NotNull Version
The field for theversion
record component. -
Constructor Summary
ConstructorsConstructorDescriptionXmlDeclaration
(@NotNull Version version) Constructs a new xml declaration with the given version and encoding.
The encoding and standalone flag are set to UTF-8 and false respectively.XmlDeclaration
(@NotNull Version version, @NotNull Charset encoding) Constructs a new xml declaration with the given version and encoding.
The standalone flag is set to false.XmlDeclaration
(@NotNull Version version, @NotNull Charset encoding, boolean standalone) Constructs a new xml declaration with the given version, encoding and standalone flag. -
Method Summary
Modifier and TypeMethodDescription@NotNull Charset
encoding()
Returns the value of theencoding
record component.boolean
Indicates whether some other object is "equal to" this one.int
hashCode()
Returns a hash code value for this object.boolean
Returns the value of thestandalone
record component.toString()
Returns a string representation of this record class.@NotNull Version
version()
Returns the value of theversion
record component.
-
Field Details
-
version
The field for theversion
record component. -
encoding
The field for theencoding
record component. -
standalone
private final boolean standaloneThe field for thestandalone
record component.
-
-
Constructor Details
-
XmlDeclaration
public XmlDeclaration(@NotNull @NotNull Version version, @NotNull @NotNull Charset encoding, boolean standalone) Constructs a new xml declaration with the given version, encoding and standalone flag.- Parameters:
version
- The version of the xml documentencoding
- The encoding of the xml documentstandalone
- Whether the xml document is standalone or not- Throws:
NullPointerException
- If the version or encoding is nullIllegalArgumentException
- If the version is invalid
-
XmlDeclaration
Constructs a new xml declaration with the given version and encoding.
The encoding and standalone flag are set to UTF-8 and false respectively.- Parameters:
version
- The version of the xml document- Throws:
NullPointerException
- If the version is nullIllegalArgumentException
- If the version is invalid
-
XmlDeclaration
Constructs a new xml declaration with the given version and encoding.
The standalone flag is set to false.- Parameters:
version
- The version of the xml documentencoding
- The encoding of the xml document- Throws:
NullPointerException
- If the version or encoding is nullIllegalArgumentException
- If the version is invalid
-
-
Method Details
-
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 '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
version
Returns the value of theversion
record component.- Returns:
- the value of the
version
record component
-
encoding
Returns the value of theencoding
record component.- Returns:
- the value of the
encoding
record component
-
standalone
public boolean standalone()Returns the value of thestandalone
record component.- Returns:
- the value of the
standalone
record component
-