Top Description Inners Fields Constructors Methods
org.springframework.messaging.rsocket.service

public final Class RSocketRequestValues

extends Object
Class Inheritance
Imports
java.util.ArrayList, .Collections, .LinkedHashMap, .List, .Map, org.reactivestreams.Publisher, org.springframework.core.ParameterizedTypeReference, org.springframework.lang.Nullable, org.springframework.util.Assert, .MimeType, .StringUtils

Container for RSocket request values extracted from an @RSocketExchange-annotated method and argument values passed to it. This is then used to define a request via org.springframework.messaging.rsocket.RSocketRequester.
Author
Rossen Stoyanchev
Since
6.0

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
private static class
RSocketRequestValues.MetadataHelper

Class that helps to collect a map of metadata entries as a series of calls to provide each metadata and mime type pair.

Field Summary

Modifier and TypeField and Description
private final Map<Object, MimeType>
private final Publisher<?>
private final ParameterizedTypeReference<?>
private final Object
private final String
private final Object[]

Constructor Summary

AccessConstructor and Description
public
RSocketRequestValues(String route, List<Object> routeVariables, RSocketRequestValues.MetadataHelper metadataHelper, Object payloadValue, Publisher<?> payload, ParameterizedTypeReference<?> payloadElementType)

Method Summary

Modifier and TypeMethod and Description
public static RSocketRequestValues.Builder
builder(String route)

public Map<Object, MimeType>
public Publisher<?>
getPayload()

Return the request payload as a Publisher.

public ParameterizedTypeReference<?>
getPayloadElementType()

Return the element type for a Publisher payload.

public Object
getPayloadValue()

Return the request payload as a value to be serialized, if set.

public String
getRoute()

Return the route value for route.

public Object[]
getRouteVariables()

Return the route variables for route.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

metadataback to summary
private final Map<Object, MimeType> metadata
payloadback to summary
private final Publisher<?> payload
Annotations
@Nullable
payloadElementTypeback to summary
private final ParameterizedTypeReference<?> payloadElementType
Annotations
@Nullable
payloadValueback to summary
private final Object payloadValue
Annotations
@Nullable
routeback to summary
private final String route
Annotations
@Nullable
routeVariablesback to summary
private final Object[] routeVariables

Constructor Detail

RSocketRequestValuesback to summary
public RSocketRequestValues(String route, List<Object> routeVariables, RSocketRequestValues.MetadataHelper metadataHelper, Object payloadValue, Publisher<?> payload, ParameterizedTypeReference<?> payloadElementType)

Method Detail

builderback to summary
public static RSocketRequestValues.Builder builder(String route)
getMetadataback to summary
public Map<Object, MimeType> getMetadata()

Return the metadata entries for org.springframework.messaging.rsocket.RSocketRequester.RequestSpec#metadata(Object, MimeType).

getPayloadback to summary
public Publisher<?> getPayload()

Return the request payload as a Publisher.

This is mutually exclusive with getPayloadValue(). Only one of the two or neither is set.

Annotations
@Nullable
getPayloadElementTypeback to summary
public ParameterizedTypeReference<?> getPayloadElementType()

Return the element type for a Publisher payload.

Annotations
@Nullable
getPayloadValueback to summary
public Object getPayloadValue()

Return the request payload as a value to be serialized, if set.

This is mutually exclusive with getPayload(). Only one of the two or neither is set.

Annotations
@Nullable
getRouteback to summary
public String getRoute()

Return the route value for route.

Annotations
@Nullable
getRouteVariablesback to summary
public Object[] getRouteVariables()

Return the route variables for route.

org.springframework.messaging.rsocket.service back to summary

public final Class RSocketRequestValues.Builder

extends Object
Class Inheritance
  • java.lang.Object
  • org.springframework.messaging.rsocket.service.RSocketRequestValues.Builder

Builder for RSocketRequestValues.

Field Summary

Modifier and TypeField and Description
private RSocketRequestValues.MetadataHelper
private Publisher<?>
private ParameterizedTypeReference<?>
private Object
private String
private List<Object>

Constructor Summary

AccessConstructor and Description
pack-priv
Builder(String route)

Method Summary

Modifier and TypeMethod and Description
public RSocketRequestValues.Builder
addMetadata(Object metadata)

Add a metadata entry.

public RSocketRequestValues.Builder
addMimeType(MimeType mimeType)

Set the mime type for a metadata entry.

public RSocketRequestValues.Builder
addRouteVariable(Object variable)

Add a route variable.

public RSocketRequestValues
build()

Build the RSocketRequestValues instance.

public <T, P extends Publisher<T>> RSocketRequestValues.Builder
setPayload(P payload, ParameterizedTypeReference<T> elementTye)

Set the request payload value to be serialized.

public RSocketRequestValues.Builder
setPayloadValue(Object payloadValue)

Set the request payload as a concrete value to be serialized.

public RSocketRequestValues.Builder
setRoute(String route)

Set the route for the request.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

metadataHelperback to summary
private RSocketRequestValues.MetadataHelper metadataHelper
Annotations
@Nullable
payloadback to summary
private Publisher<?> payload
Annotations
@Nullable
payloadElementTypeback to summary
private ParameterizedTypeReference<?> payloadElementType
Annotations
@Nullable
payloadValueback to summary
private Object payloadValue
Annotations
@Nullable
routeback to summary
private String route
Annotations
@Nullable
routeVariablesback to summary
private List<Object> routeVariables
Annotations
@Nullable

Constructor Detail

Builderback to summary
pack-priv Builder(String route)

Method Detail

addMetadataback to summary
public RSocketRequestValues.Builder addMetadata(Object metadata)

Add a metadata entry. This must be followed by a corresponding call to addMimeType(MimeType).

addMimeTypeback to summary
public RSocketRequestValues.Builder addMimeType(MimeType mimeType)

Set the mime type for a metadata entry. This must be preceded by a call to addMetadata(Object).

addRouteVariableback to summary
public RSocketRequestValues.Builder addRouteVariable(Object variable)

Add a route variable.

buildback to summary
public RSocketRequestValues build()

Build the RSocketRequestValues instance.

setPayloadback to summary
public <T, P extends Publisher<T>> RSocketRequestValues.Builder setPayload(P payload, ParameterizedTypeReference<T> elementTye)

Set the request payload value to be serialized.

setPayloadValueback to summary
public RSocketRequestValues.Builder setPayloadValue(Object payloadValue)

Set the request payload as a concrete value to be serialized.

This is mutually exclusive with, and resets any previously set payload Publisher.

setRouteback to summary
public RSocketRequestValues.Builder setRoute(String route)

Set the route for the request.

org.springframework.messaging.rsocket.service back to summary

private Class RSocketRequestValues.MetadataHelper

extends Object
Class Inheritance
  • java.lang.Object
  • org.springframework.messaging.rsocket.service.RSocketRequestValues.MetadataHelper

Class that helps to collect a map of metadata entries as a series of calls to provide each metadata and mime type pair.

Field Summary

Modifier and TypeField and Description
private final List<Object>
private final List<MimeType>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
addMetadata(Object metadata)

public void
public Map<Object, MimeType>
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

metadataback to summary
private final List<Object> metadata
mimeTypesback to summary
private final List<MimeType> mimeTypes

Constructor Detail

MetadataHelperback to summary
private MetadataHelper()

Method Detail

addMetadataback to summary
public void addMetadata(Object metadata)
addMimeTypeback to summary
public void addMimeType(MimeType mimeType)
toMapback to summary
public Map<Object, MimeType> toMap()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override