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 CharsetThe field for theencodingrecord component.private final booleanThe field for thestandalonerecord component.private final @NotNull VersionThe field for theversionrecord 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 Charsetencoding()Returns the value of theencodingrecord component.booleanIndicates whether some other object is "equal to" this one.inthashCode()Returns a hash code value for this object.booleanReturns the value of thestandalonerecord component.toString()Returns a string representation of this record class.@NotNull Versionversion()Returns the value of theversionrecord component.
-
Field Details
-
version
The field for theversionrecord component. -
encoding
The field for theencodingrecord component. -
standalone
private final boolean standaloneThe field for thestandalonerecord 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 theversionrecord component.- Returns:
- the value of the
versionrecord component
-
encoding
Returns the value of theencodingrecord component.- Returns:
- the value of the
encodingrecord component
-
standalone
public boolean standalone()Returns the value of thestandalonerecord component.- Returns:
- the value of the
standalonerecord component
-