Record Class MultipartParser.Limits

java.lang.Object
java.lang.Record
com.jsgalactic.axiom.http.MultipartParser.Limits
Enclosing class:
MultipartParser

public static record MultipartParser.Limits(int maxParts, int maxPartBytes, int maxHeaderBytes, long maxTotalBytes) extends Record
Bounds applied while a multipart body is read.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    Sixteen parts of at most 1 MiB, 8 KiB of headers per part and 16 MiB in total.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Limits(int maxParts, int maxPartBytes, int maxHeaderBytes, long maxTotalBytes)
    Validates and creates limits; every bound must be positive.
  • Method Summary

    Modifier and Type
    Method
    Description
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    int
    Returns the value of the maxHeaderBytes record component.
    int
    Returns the value of the maxPartBytes record component.
    int
    Returns the value of the maxParts record component.
    long
    Returns the value of the maxTotalBytes record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • DEFAULT

      public static final MultipartParser.Limits DEFAULT
      Sixteen parts of at most 1 MiB, 8 KiB of headers per part and 16 MiB in total.
  • Constructor Details

    • Limits

      public Limits(int maxParts, int maxPartBytes, int maxHeaderBytes, long maxTotalBytes)
      Validates and creates limits; every bound must be positive.
      Parameters:
      maxParts - largest number of parts
      maxPartBytes - largest content of one part
      maxHeaderBytes - largest header section of one part, including line ends
      maxTotalBytes - largest number of body bytes read, including framing
      Throws:
      IllegalArgumentException - if any bound is not positive
  • Method Details

    • 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 '=='.
      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.
    • maxParts

      public int maxParts()
      Returns the value of the maxParts record component.
      Returns:
      the value of the maxParts record component
    • maxPartBytes

      public int maxPartBytes()
      Returns the value of the maxPartBytes record component.
      Returns:
      the value of the maxPartBytes record component
    • maxHeaderBytes

      public int maxHeaderBytes()
      Returns the value of the maxHeaderBytes record component.
      Returns:
      the value of the maxHeaderBytes record component
    • maxTotalBytes

      public long maxTotalBytes()
      Returns the value of the maxTotalBytes record component.
      Returns:
      the value of the maxTotalBytes record component