Record Class ArrayElement
java.lang.Object
java.lang.Record
eu.cloudnetservice.driver.document.send.element.ArrayElement
- Record Components:
key- the key of this element orElement.NO_KEYif an array entry.entries- the entries of the array element.
- All Implemented Interfaces:
Element
public record ArrayElement(@NonNull String key, @NonNull @Unmodifiable Collection<? extends Element> entries)
extends Record
implements Element
An element that contains multiple sub elements (of any type). Note that array entry elements always have no key given
(see
Element.NO_KEY).- Since:
- 4.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final @NonNull @Unmodifiable Collection<? extends Element> The field for theentriesrecord component.The field for thekeyrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionArrayElement(@NonNull String key, @NonNull @Unmodifiable Collection<? extends Element> entries) Creates an instance of aArrayElementrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(@NonNull ElementVisitor visitor) Applies the given visitor to this element.@NonNull @Unmodifiable Collection<? extends Element> entries()Returns the value of theentriesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.key()Returns the value of thekeyrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
key
-
entries
The field for theentriesrecord component.
-
-
Constructor Details
-
ArrayElement
public ArrayElement(@NonNull @NonNull String key, @NonNull @NonNull @Unmodifiable Collection<? extends Element> entries) Creates an instance of aArrayElementrecord class.
-
-
Method Details
-
accept
Applies the given visitor to this element. It is up to the implementation (and therefore the element type) to decide what steps should be executed on the given element visitor. -
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
key
-
entries
-