Created
May 23, 2014 18:05
-
-
Save augustl/d894d4a5c41529feb202 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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