/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 *  @generated
 */

package test.fixtures.basic;

import java.util.*;

public class DbMixedStackArgumentsReactiveBlockingWrapper 
  implements DbMixedStackArguments {
  private final DbMixedStackArguments.Reactive _delegate;

  public DbMixedStackArgumentsReactiveBlockingWrapper(DbMixedStackArguments.Reactive _delegate) {
    
    this._delegate = _delegate;
  }

  public DbMixedStackArgumentsReactiveBlockingWrapper(org.apache.thrift.ProtocolId _protocolId, reactor.core.publisher.Mono<? extends com.facebook.thrift.client.RpcClient> _rpcClient, Map<String, String> _headers, Map<String, String> _persistentHeaders) {
    this(new DbMixedStackArgumentsReactiveClient(_protocolId, _rpcClient, _headers, _persistentHeaders));
  }

  @java.lang.Override
  public void close() {
    _delegate.dispose();
  }

  @java.lang.Override
  public byte[] getDataByKey0( final String key) throws org.apache.thrift.TException {
      return getDataByKey0Wrapper(key, com.facebook.thrift.client.RpcOptions.EMPTY).getData();
  }

  @java.lang.Override
  public byte[] getDataByKey0(
        final String key,
        com.facebook.thrift.client.RpcOptions rpcOptions) throws org.apache.thrift.TException {
      return getDataByKey0Wrapper(key,rpcOptions).getData();
  }

  @java.lang.Override
  public com.facebook.thrift.client.ResponseWrapper<byte[]> getDataByKey0Wrapper(
    final String key,
    com.facebook.thrift.client.RpcOptions rpcOptions) throws org.apache.thrift.TException {
      try {
        return _delegate.getDataByKey0Wrapper(key, rpcOptions).block();
      } catch (Throwable t) {
        throw com.facebook.thrift.util.ExceptionUtil.wrap(t);
      }
  }
  @java.lang.Override
  public byte[] getDataByKey1( final String key) throws org.apache.thrift.TException {
      return getDataByKey1Wrapper(key, com.facebook.thrift.client.RpcOptions.EMPTY).getData();
  }

  @java.lang.Override
  public byte[] getDataByKey1(
        final String key,
        com.facebook.thrift.client.RpcOptions rpcOptions) throws org.apache.thrift.TException {
      return getDataByKey1Wrapper(key,rpcOptions).getData();
  }

  @java.lang.Override
  public com.facebook.thrift.client.ResponseWrapper<byte[]> getDataByKey1Wrapper(
    final String key,
    com.facebook.thrift.client.RpcOptions rpcOptions) throws org.apache.thrift.TException {
      try {
        return _delegate.getDataByKey1Wrapper(key, rpcOptions).block();
      } catch (Throwable t) {
        throw com.facebook.thrift.util.ExceptionUtil.wrap(t);
      }
  }

}
