Skip to content

Instantly share code, notes, and snippets.

@augustl
Created May 23, 2014 18:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save augustl/d894d4a5c41529feb202 to your computer and use it in GitHub Desktop.
Save augustl/d894d4a5c41529feb202 to your computer and use it in GitHub Desktop.
public static class Builder<TT_REQ extends IRequest, TT_RES> {
private final List<Route<TT_REQ, TT_RES>> routes = new ArrayList<Route<TT_REQ, TT_RES>>();
private Builder(){}
static public <TTT_REQ extends IRequest, TTT_RES> Builder<TTT_REQ, TTT_RES> start() {
return new Builder<TTT_REQ, TTT_RES>();
}
public Builder<TT_REQ, TT_RES> add(Route<TT_REQ, TT_RES> route) {
this.routes.add(route);
return this;
}
public PathTravelAgent<TT_REQ, TT_RES> build() {
return new PathTravelAgent<TT_REQ, TT_RES>(this.routes);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment