Record Class ConcatenatingSubscriber.Separators

java.lang.Object
java.lang.Record
io.micronaut.http.body.ConcatenatingSubscriber.Separators
Record Components:
beforeFirst - If there are any items, the buffer to insert before the first one
afterLast - If there are any items, the buffer to insert after the last one
between - Buffer to insert between any items
empty - Buffer to insert if there are no items
Enclosing class:
ConcatenatingSubscriber

public static record ConcatenatingSubscriber.Separators(@Nullable ReadBuffer beforeFirst, @Nullable ReadBuffer afterLast, @Nullable ReadBuffer between, @Nullable ReadBuffer empty) extends Record
Fixed buffers to insert before, after and between items.
  • Field Details

  • Constructor Details

    • Separators

      public Separators(@Nullable ReadBuffer beforeFirst, @Nullable ReadBuffer afterLast, @Nullable ReadBuffer between, @Nullable ReadBuffer empty)
      Creates an instance of a Separators record class.
      Parameters:
      beforeFirst - the value for the beforeFirst record component
      afterLast - the value for the afterLast record component
      between - the value for the between record component
      empty - the value for the empty record component
  • Method Details

    • jsonSeparators

      public static @NonNull ConcatenatingSubscriber.Separators jsonSeparators(@NonNull ReadBufferFactory factory)
      Create the appropriate separators for JSON using the given buffer factory.
      Parameters:
      factory - The factory to use
      Returns:
      The separators
    • 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.
    • beforeFirst

      public @Nullable ReadBuffer beforeFirst()
      Returns the value of the beforeFirst record component.
      Returns:
      the value of the beforeFirst record component
    • afterLast

      public @Nullable ReadBuffer afterLast()
      Returns the value of the afterLast record component.
      Returns:
      the value of the afterLast record component
    • between

      public @Nullable ReadBuffer between()
      Returns the value of the between record component.
      Returns:
      the value of the between record component
    • empty

      public @Nullable ReadBuffer empty()
      Returns the value of the empty record component.
      Returns:
      the value of the empty record component