@@ -238,9 +238,9 @@ interface Builder {
238
238
}
239
239
240
240
/**
241
- * Spec for providing input data for an RSocket request and triggering the exchange .
241
+ * Spec to declare the input for an RSocket request.
242
242
*/
243
- interface RequestSpec extends MetadataSpec <RequestSpec > {
243
+ interface RequestSpec extends MetadataSpec <RequestSpec >, RetrieveSpec {
244
244
245
245
/**
246
246
* Append additional metadata entries through a {@code Consumer}.
@@ -262,7 +262,7 @@ interface RequestSpec extends MetadataSpec<RequestSpec> {
262
262
* @param data the Object value for the payload data
263
263
* @return spec to declare the expected response
264
264
*/
265
- RequestSpec data (Object data );
265
+ RetrieveSpec data (Object data );
266
266
267
267
/**
268
268
* Variant of {@link #data(Object)} that also accepts a hint for the
@@ -274,7 +274,7 @@ interface RequestSpec extends MetadataSpec<RequestSpec> {
274
274
* @param elementClass the type of values to be produced
275
275
* @return spec to declare the expected response
276
276
*/
277
- RequestSpec data (Object producer , Class <?> elementClass );
277
+ RetrieveSpec data (Object producer , Class <?> elementClass );
278
278
279
279
/**
280
280
* Variant of {@link #data(Object, Class)} for when the type hint has
@@ -285,7 +285,38 @@ interface RequestSpec extends MetadataSpec<RequestSpec> {
285
285
* @param elementTypeRef the type of values to be produced
286
286
* @return spec to declare the expected response
287
287
*/
288
- RequestSpec data (Object producer , ParameterizedTypeReference <?> elementTypeRef );
288
+ RetrieveSpec data (Object producer , ParameterizedTypeReference <?> elementTypeRef );
289
+ }
290
+
291
+
292
+ /**
293
+ * Spec for providing additional composite metadata entries.
294
+ *
295
+ * @param <S> a self reference to the spec type
296
+ */
297
+ interface MetadataSpec <S extends MetadataSpec <S >> {
298
+
299
+ /**
300
+ * Use this to append additional metadata entries when using composite
301
+ * metadata. An {@link IllegalArgumentException} is raised if this
302
+ * method is used when not using composite metadata.
303
+ * The metadata value be a concrete value or any producer of a single
304
+ * value that can be adapted to a {@link Publisher} via
305
+ * {@link ReactiveAdapterRegistry}.
306
+ * @param metadata an Object to be encoded with a suitable
307
+ * {@link org.springframework.core.codec.Encoder Encoder}, or a
308
+ * {@link org.springframework.core.io.buffer.DataBuffer DataBuffer}
309
+ * @param mimeType the mime type that describes the metadata
310
+ */
311
+ S metadata (Object metadata , MimeType mimeType );
312
+ }
313
+
314
+
315
+ /**
316
+ * Spec to declare the expected output for an RSocket request.
317
+ * @since 5.2.2
318
+ */
319
+ interface RetrieveSpec {
289
320
290
321
/**
291
322
* Perform a {@link RSocket#fireAndForget fireAndForget}.
@@ -330,26 +361,4 @@ interface RequestSpec extends MetadataSpec<RequestSpec> {
330
361
<T > Flux <T > retrieveFlux (ParameterizedTypeReference <T > dataTypeRef );
331
362
}
332
363
333
- /**
334
- * Spec for specifying the metadata.
335
- *
336
- * @param <S> a self reference to the spec type
337
- */
338
- interface MetadataSpec <S extends MetadataSpec <S >> {
339
-
340
- /**
341
- * Use this to append additional metadata entries when using composite
342
- * metadata. An {@link IllegalArgumentException} is raised if this
343
- * method is used when not using composite metadata.
344
- * The metadata value be a concrete value or any producer of a single
345
- * value that can be adapted to a {@link Publisher} via
346
- * {@link ReactiveAdapterRegistry}.
347
- * @param metadata an Object to be encoded with a suitable
348
- * {@link org.springframework.core.codec.Encoder Encoder}, or a
349
- * {@link org.springframework.core.io.buffer.DataBuffer DataBuffer}
350
- * @param mimeType the mime type that describes the metadata
351
- */
352
- S metadata (Object metadata , MimeType mimeType );
353
- }
354
-
355
364
}
0 commit comments