- java.lang.Object
-
- io.helidon.media.common.StringBodyReader
-
- All Implemented Interfaces:
MessageBodyOperator<MessageBodyReaderContext>,MessageBodyReader<String>
public final class StringBodyReader extends Object implements MessageBodyReader<String>
Message body reader forString.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccept(GenericType<?> type, MessageBodyReaderContext context)Test if the operator can convert the given type.static StringBodyReadercreate()Create a new instance ofStringBodyReader.<U extends String>
Single<U>read(Flow.Publisher<DataChunk> publisher, GenericType<U> type, MessageBodyReaderContext context)Convert a HTTP payload into a Single publisher of the given type.
-
-
-
Method Detail
-
accept
public boolean accept(GenericType<?> type, MessageBodyReaderContext context)
Description copied from interface:MessageBodyOperatorTest if the operator can convert the given type.- Specified by:
acceptin interfaceMessageBodyOperator<MessageBodyReaderContext>- Parameters:
type- the requested typecontext- the context providing the headers abstraction- Returns:
trueif the operator can convert the specified type in the given context,falseotherwise
-
read
public <U extends String> Single<U> read(Flow.Publisher<DataChunk> publisher, GenericType<U> type, MessageBodyReaderContext context)
Description copied from interface:MessageBodyReaderConvert a HTTP payload into a Single publisher of the given type.- Specified by:
readin interfaceMessageBodyReader<String>- Type Parameters:
U- actual requested type parameter- Parameters:
publisher- HTTP payloadtype- requested typecontext- the context providing the headers abstraction- Returns:
- Single publisher
-
create
public static StringBodyReader create()
Create a new instance ofStringBodyReader.- Returns:
Stringmessage body reader.
-
-