Package io.micronaut.http.body
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 oneafterLast
- If there are any items, the buffer to insert after the last onebetween
- Buffer to insert between any itemsempty
- 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final ConcatenatingSubscriber.Separators
static final ConcatenatingSubscriber.Separators
No separators. -
Constructor Summary
ConstructorsConstructorDescriptionSeparators
(@Nullable ReadBuffer beforeFirst, @Nullable ReadBuffer afterLast, @Nullable ReadBuffer between, @Nullable ReadBuffer empty) Creates an instance of aSeparators
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theafterLast
record component.Returns the value of thebeforeFirst
record component.between()
Returns the value of thebetween
record component.empty()
Returns the value of theempty
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.jsonSeparators
(@NonNull ReadBufferFactory factory) Create the appropriate separators for JSON using the given buffer factory.final String
toString()
Returns a string representation of this record class.
-
Field Details
-
NONE
No separators. -
JDK_JSON
-
-
Constructor Details
-
Separators
public Separators(@Nullable @Nullable ReadBuffer beforeFirst, @Nullable @Nullable ReadBuffer afterLast, @Nullable @Nullable ReadBuffer between, @Nullable @Nullable ReadBuffer empty) Creates an instance of aSeparators
record class.- Parameters:
beforeFirst
- the value for thebeforeFirst
record componentafterLast
- the value for theafterLast
record componentbetween
- the value for thebetween
record componentempty
- the value for theempty
record component
-
-
Method Details
-
jsonSeparators
@NonNull public static @NonNull ConcatenatingSubscriber.Separators jsonSeparators(@NonNull @NonNull ReadBufferFactory factory) Create the appropriate separators for JSON using the given buffer factory.- Parameters:
factory
- The factory to use- Returns:
- The separators
-
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)
. -
beforeFirst
Returns the value of thebeforeFirst
record component.- Returns:
- the value of the
beforeFirst
record component
-
afterLast
Returns the value of theafterLast
record component.- Returns:
- the value of the
afterLast
record component
-
between
Returns the value of thebetween
record component.- Returns:
- the value of the
between
record component
-
empty
Returns the value of theempty
record component.- Returns:
- the value of the
empty
record component
-