Skip to content

Instantly share code, notes, and snippets.

@arganzheng
Created October 31, 2013 06:59
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 arganzheng/7245337 to your computer and use it in GitHub Desktop.
Save arganzheng/7245337 to your computer and use it in GitHub Desktop.

优雅的builder模式

public class NetworkUpdatesService{

	public void getNetworkUpdatesSummary(){
		UpdateQueryCriteria query = UpdateQueryCriteria.createDefaultCriteria()
				.setMemberID(2)
				.setRequestdTypes(NetworkUpdateType.CONNECTION)
				.setCutoffDate(...)
				.setMaxNumberOfUpdates(10);

		MyNetworkUpdatesService service = getService(MyNetworkUpdatesService.class);

		DateTree update = service.getNetworkUpdatesSummary(query);
	}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment