/** * Returns a test instance of {@link RequestResponseFrame}. * * @return a test instance of {@link RequestResponseFrame} */ public static RequestResponseFrame createTestRequestResponseFrame() { return createRequestResponseFrame(DEFAULT, false, (ByteBuf) null, null); }
public static RequestResponseFrame createTestRequestResponseFrame() { return createRequestResponseFrame(DEFAULT, false, (ByteBuf) null, null); }
@Override public RequestResponseFrame createNonFragment( ByteBufAllocator byteBufAllocator, @Nullable ByteBuf metadata, @Nullable ByteBuf data) { return createRequestResponseFrame(byteBufAllocator, false, metadata, data); }
@Override public RequestResponseFrame createFragment( ByteBufAllocator byteBufAllocator, @Nullable ByteBuf metadata, @Nullable ByteBuf data) { return createRequestResponseFrame(byteBufAllocator, true, metadata, data); }
/** * Creates the {@code REQUEST_RESPONSE} frame. * * @param byteBufAllocator the {@code ByteBufAllocator} to use * @param follows whether to set the Follows flag * @param metadata the metadata * @param data the data * @return the {@code REQUEST_RESPONSE} frame * @throws NullPointerException if {@code byteBufAllocator} is {@code null} */ public static RequestResponseFrame createRequestResponseFrame( ByteBufAllocator byteBufAllocator, boolean follows, @Nullable String metadata, @Nullable String data) { ByteBuf metadataByteBuf = getUtf8AsByteBuf(metadata); ByteBuf dataByteBuf = getUtf8AsByteBuf(data); try { return createRequestResponseFrame(byteBufAllocator, follows, metadataByteBuf, dataByteBuf); } finally { release(metadataByteBuf); release(dataByteBuf); } }
return createKeepaliveFrame(byteBuf); case REQUEST_RESPONSE: return createRequestResponseFrame(byteBuf); case REQUEST_FNF: return createRequestFireAndForgetFrame(byteBuf);
@DisplayName("createRequestResponseFrame throws NullPointerException with null byteBufAllocator") @Test void createRequestResponseFrameNullByteBufAllocator() { assertThatNullPointerException() .isThrownBy(() -> createRequestResponseFrame(null, false, (ByteBuf) null, null)) .withMessage("byteBufAllocator must not be null"); }
@Override public RequestResponseFrame createFragment( ByteBufAllocator byteBufAllocator, @Nullable ByteBuf metadata, @Nullable ByteBuf data) { return createRequestResponseFrame(byteBufAllocator, true, metadata, data); }
@Override public RequestResponseFrame createNonFragment( ByteBufAllocator byteBufAllocator, @Nullable ByteBuf metadata, @Nullable ByteBuf data) { return createRequestResponseFrame(byteBufAllocator, false, metadata, data); }
/** * Creates the {@code REQUEST_RESPONSE} frame. * * @param byteBufAllocator the {@code ByteBufAllocator} to use * @param follows whether to set the Follows flag * @param metadata the metadata * @param data the data * @return the {@code REQUEST_RESPONSE} frame * @throws NullPointerException if {@code byteBufAllocator} is {@code null} */ public static RequestResponseFrame createRequestResponseFrame( ByteBufAllocator byteBufAllocator, boolean follows, @Nullable String metadata, @Nullable String data) { ByteBuf metadataByteBuf = getUtf8AsByteBuf(metadata); ByteBuf dataByteBuf = getUtf8AsByteBuf(data); try { return createRequestResponseFrame(byteBufAllocator, follows, metadataByteBuf, dataByteBuf); } finally { release(metadataByteBuf); release(dataByteBuf); } }
return createKeepaliveFrame(byteBuf); case REQUEST_RESPONSE: return createRequestResponseFrame(byteBuf); case REQUEST_FNF: return createRequestFireAndForgetFrame(byteBuf);