Record Class MultipartFormBody.MultipartData
java.lang.Object
java.lang.Record
de.craftsblock.craftsnet.api.http.body.bodies.MultipartFormBody.MultipartData
- Enclosing class:
- MultipartFormBody
public static record MultipartFormBody.MultipartData(String name, List<MultipartFormBody.MultipartItem> items)
extends Record
The
MultipartData class represents the multipart data for a single field in the
multipart/form-data.- Since:
- 2.2.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMultipartData(String name, List<MultipartFormBody.MultipartItem> items) Creates an instance of aMultipartDatarecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.first()Gets the first item in the multipart data for the field.final inthashCode()Returns a hash code value for this object.booleanisEmpty()Checks if the multipart data for the field is empty.items()Returns the value of theitemsrecord component.name()Returns the value of thenamerecord component.intsize()Gets the number of items in the multipart data for the field.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MultipartData
Creates an instance of aMultipartDatarecord class.- Parameters:
name- the value for thenamerecord componentitems- the value for theitemsrecord component
-
-
Method Details
-
size
public int size()Gets the number of items in the multipart data for the field.- Returns:
- The number of items.
-
isEmpty
public boolean isEmpty()Checks if the multipart data for the field is empty.- Returns:
trueif it's empty, otherwisefalse.
-
first
Gets the first item in the multipart data for the field.- Returns:
- The first item, or
nullif the data is empty.
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
name
Returns the value of thenamerecord component.- Returns:
- the value of the
namerecord component
-
items
Returns the value of theitemsrecord component.- Returns:
- the value of the
itemsrecord component
-