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 io.micronaut.core.io.buffer.ReadBuffer beforeFirst, @Nullable io.micronaut.core.io.buffer.ReadBuffer afterLast, @Nullable io.micronaut.core.io.buffer.ReadBuffer between, @Nullable io.micronaut.core.io.buffer.ReadBuffer empty)
extends Record
Fixed buffers to insert before, after and between items.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ConcatenatingSubscriber.SeparatorsjsonSeparators(ReadBufferFactory)usingReadBufferFactory.getJdkFactory().static final ConcatenatingSubscriber.SeparatorsNo separators. -
Constructor Summary
ConstructorsConstructorDescriptionSeparators(@Nullable io.micronaut.core.io.buffer.ReadBuffer beforeFirst, @Nullable io.micronaut.core.io.buffer.ReadBuffer afterLast, @Nullable io.micronaut.core.io.buffer.ReadBuffer between, @Nullable io.micronaut.core.io.buffer.ReadBuffer empty) Creates an instance of aSeparatorsrecord class. -
Method Summary
Modifier and TypeMethodDescription@Nullable io.micronaut.core.io.buffer.ReadBufferReturns the value of theafterLastrecord component.@Nullable io.micronaut.core.io.buffer.ReadBufferReturns the value of thebeforeFirstrecord component.@Nullable io.micronaut.core.io.buffer.ReadBufferbetween()Returns the value of thebetweenrecord component.@Nullable io.micronaut.core.io.buffer.ReadBufferempty()Returns the value of theemptyrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static @NonNull ConcatenatingSubscriber.SeparatorsjsonSeparators(@NonNull io.micronaut.core.io.buffer.ReadBufferFactory factory) Create the appropriate separators for JSON using the given buffer factory.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
NONE
No separators. -
JDK_JSON
jsonSeparators(ReadBufferFactory)usingReadBufferFactory.getJdkFactory().
-
-
Constructor Details
-
Separators
public Separators(@Nullable @Nullable io.micronaut.core.io.buffer.ReadBuffer beforeFirst, @Nullable @Nullable io.micronaut.core.io.buffer.ReadBuffer afterLast, @Nullable @Nullable io.micronaut.core.io.buffer.ReadBuffer between, @Nullable @Nullable io.micronaut.core.io.buffer.ReadBuffer empty) Creates an instance of aSeparatorsrecord class.- Parameters:
beforeFirst- the value for thebeforeFirstrecord componentafterLast- the value for theafterLastrecord componentbetween- the value for thebetweenrecord componentempty- the value for theemptyrecord component
-
-
Method Details
-
jsonSeparators
@NonNull public static @NonNull ConcatenatingSubscriber.Separators jsonSeparators(@NonNull @NonNull io.micronaut.core.io.buffer.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
@Nullable public @Nullable io.micronaut.core.io.buffer.ReadBuffer beforeFirst()Returns the value of thebeforeFirstrecord component.- Returns:
- the value of the
beforeFirstrecord component
-
afterLast
@Nullable public @Nullable io.micronaut.core.io.buffer.ReadBuffer afterLast()Returns the value of theafterLastrecord component.- Returns:
- the value of the
afterLastrecord component
-
between
@Nullable public @Nullable io.micronaut.core.io.buffer.ReadBuffer between()Returns the value of thebetweenrecord component.- Returns:
- the value of the
betweenrecord component
-
empty
@Nullable public @Nullable io.micronaut.core.io.buffer.ReadBuffer empty()Returns the value of theemptyrecord component.- Returns:
- the value of the
emptyrecord component
-