eventcallback/src/main/java/com/byoutline/eventcallback/EventCallback.java
public static <S, E> EventCallbackBuilder<S, E> builder(@Nonnull CallbackConfig config,
                                                            @Nonnull TypeToken<E> errorTypeToken) {
        return new EventCallbackBuilder<S, E>(config, errorTypeToken);
    }
public static <S, E> EventCallbackBuilder<S, E> builder(@Nonnull CallbackConfig config,
                                                            @Nonnull TypeToken<E> errorTypeToken) {
        return new EventCallbackBuilder<S, E>(config, errorTypeToken);
    }
public static < S , E > EventCallbackBuilder < S , E > builder ( @ Nonnull CallbackConfig config , @ Nonnull TypeToken < E > errorTypeToken ) { return new EventCallbackBuilder < S , E > ( config , errorTypeToken ) ; }
Returns builder that creates {@link EventCallback}.
<p>
To avoid passing all arguments on each callback creation it is suggested
to wrap this call in project. For example:
<p>
<pre><code class="java">
class MyEventCallback&lt;S&gt; {
<p>
CallbackConfig config = injected;
private EventCallbackBuilder&lt;S, MyHandledErrorMsg&gt; builder() {
return EventCallback.builder(config, new TypeToken&lt;MyHandledErrorMsg&gt;(){});
}
<p>
public static &lt;S&gt; EventCallbackBuilder&lt;S, MyHandledErrorMsg&gt; ofType() {
return new MyEventCallback&lt;S&gt;().builder(responseType);
}
}
</code></pre>

@param <S>            Type of response returned by server onSuccess
@param <E>            Type of response returned by server onError
@param config         Shared configuration
@param errorTypeToken TypeToken that provides information about expected
response returned by server
@return Builder that assists in creating valid EventCallback in readable
way.
Returns builder that creates { @link EventCallback } . <p > To avoid passing all arguments on each callback creation it is suggested to wrap this call in project . For example : <p > <pre > <code class = java > class MyEventCallback&lt ; S&gt ; { <p > CallbackConfig config = injected ; private EventCallbackBuilder&lt ; S MyHandledErrorMsg&gt ; builder () { return EventCallback . builder ( config new TypeToken&lt ; MyHandledErrorMsg&gt ; () {} ) ; } <p > public static &lt ; S&gt ; EventCallbackBuilder&lt ; S MyHandledErrorMsg&gt ; ofType () { return new MyEventCallback&lt ; S&gt ; () . builder ( responseType ) ; } } < / code > < / pre >