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 Details

    • MultipartData

      public MultipartData(String name, List<MultipartFormBody.MultipartItem> items)
      Creates an instance of a MultipartData record class.
      Parameters:
      name - the value for the name record component
      items - the value for the items record 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:
      true if it's empty, otherwise false.
    • first

      Gets the first item in the multipart data for the field.
      Returns:
      The first item, or null if the data is empty.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      public String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • items

      Returns the value of the items record component.
      Returns:
      the value of the items record component