Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
titleForwardingAdmin.java
public class ForwardingAdmin implements Admin {
    private final Admin delegate;

    public ForwardingAdmin(Map<String, Object> config, Admin delegate) {
        this.delegate = delegate;
    }
    
    public ForwardingAdmin(final Admin delegate) {
        this.delegate = delegate;
    }
    
    @Override
    public CreateTopicsResult createTopics(Collection<NewTopic> newTopics, CreateTopicsOptions options) {
        return delegate.createTopics(newTopics, options);
    }
    
    // override rest of Admin interface to use delegate...
}

...