diff --git a/navalplanner-webapp/src/main/java/org/navalplanner/web/resources/search/IResourceSearchModel.java b/navalplanner-webapp/src/main/java/org/navalplanner/web/resources/search/IResourceSearchModel.java index 427c45dda..7e1f12746 100644 --- a/navalplanner-webapp/src/main/java/org/navalplanner/web/resources/search/IResourceSearchModel.java +++ b/navalplanner-webapp/src/main/java/org/navalplanner/web/resources/search/IResourceSearchModel.java @@ -41,12 +41,38 @@ public interface IResourceSearchModel { public interface IResourcesQuery { + /** + * Restrict the result to resources that have name as a substring. The + * match is case insensitive. + * + * @param name + * @return this same object in order to cascade calls + */ IResourcesQuery byName(String name); + /** + * Restrict the result to a list of {@link Resource} satisfying all + * criteria at some point in time + * + * @param criteria + * @return this same object in order to cascade calls + */ IResourcesQuery byCriteria(Collection criteria); + /** + * Restrict resources to the ones having the provided limiting value. By + * default, if this method is not called, the resources are restricted + * to the ones not limiting. + * @param limiting + * @return this same object in order to cascade calls + */ IResourcesQuery byLimiting(boolean limiting); + /** + * Retrieve the list of resources that match the restrictions specified. + * + * @return + */ List execute(); /** @@ -63,12 +89,30 @@ public interface IResourceSearchModel { Map> getCriteria(); } + /** + * Do the search limited to workers + * + * @return + */ public IResourcesQuery searchWorkers(); + /** + * Do the search limited to machines + * @return + */ public IResourcesQuery searchMachines(); + /** + * Search machines or workers based on the value of resourceType + * @param resourceType + * @return + */ public IResourcesQuery searchBy(ResourceEnum resourceType); + /** + * Search both resources and machines + * @return + */ public IResourcesQuery searchBoth(); }