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

package test.fixtures.basicannotations;

import java.util.*;

public class BadServiceReactiveBlockingWrapper 
  implements BadService {
  private final BadService.Reactive _delegate;

  public BadServiceReactiveBlockingWrapper(BadService.Reactive _delegate) {
    
    this._delegate = _delegate;
  }

  public BadServiceReactiveBlockingWrapper(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 BadServiceReactiveClient(_protocolId, _rpcClient, _headers, _persistentHeaders));
  }

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

  @java.lang.Override
  public int bar() throws org.apache.thrift.TException {
      return barWrapper(com.facebook.thrift.client.RpcOptions.EMPTY).getData();
  }

  @java.lang.Override
  public int bar(
        com.facebook.thrift.client.RpcOptions rpcOptions) throws org.apache.thrift.TException {
      return barWrapper(rpcOptions).getData();
  }

  @java.lang.Override
  public com.facebook.thrift.client.ResponseWrapper<Integer> barWrapper(
    com.facebook.thrift.client.RpcOptions rpcOptions) throws org.apache.thrift.TException {
      try {
        return _delegate.barWrapper(rpcOptions).block();
      } catch (Throwable t) {
        throw com.facebook.thrift.util.ExceptionUtil.wrap(t);
      }
  }

  public BadInteraction createBadInteraction() {
      throw new UnsupportedOperationException("Interactions are not yet supported on ReactiveBlockingWrapper Interfaces!");
  }
}
