@Test public void filter() throws Exception { SearchFilter filter = new SearchFilter(true, true); assertFalse(filter.filter(null)); filter = new SearchFilter(true, false); assertFalse(filter.filter(null)); filter = new SearchFilter(false, true); assertFalse(filter.filter(null)); filter = new SearchFilter(null, null); assertFalse(filter.filter(null)); }
@Override public boolean filter(Object datamodelObj) { if(datamodelObj instanceof DbSearch){ return includeModules.equals(((DbSearch)datamodelObj).getModules() == null || ((DbSearch)datamodelObj).getModules().isEmpty()) && includeArtifacts.equals(((DbSearch)datamodelObj).getArtifacts() == null || ((DbSearch) datamodelObj).getArtifacts().isEmpty()); } return false; }
SearchFilter implements Filter { @Override public boolean filter(Object datamodelObj) { if(datamodelObj instanceof DbSearch){ return includeModules.equals(((DbSearch)datamodelObj).getModules() == null || ((DbSearch)datamodelObj).getModules().isEmpty()) && includeArtifacts.equals(((DbSearch)datamodelObj).getArtifacts() == null || ((DbSearch) datamodelObj).getArtifacts().isEmpty()); } return false; } }
SearchFilter implements Filter { @Override public boolean filter(Object datamodelObj) { if(datamodelObj instanceof DbSearch){ return includeModules.equals(((DbSearch)datamodelObj).getModules() == null || ((DbSearch)datamodelObj).getModules().isEmpty()) && includeArtifacts.equals(((DbSearch)datamodelObj).getArtifacts() == null || ((DbSearch) datamodelObj).getArtifacts().isEmpty()); } return false; } SearchFilter(final Boolean modules, final Boolean artifacts); }
SearchFilter implements Filter { @Override public boolean filter(Object datamodelObj) { if(datamodelObj instanceof DbSearch){ return includeModules.equals(((DbSearch)datamodelObj).getModules() == null || ((DbSearch)datamodelObj).getModules().isEmpty()) && includeArtifacts.equals(((DbSearch)datamodelObj).getArtifacts() == null || ((DbSearch) datamodelObj).getArtifacts().isEmpty()); } return false; } SearchFilter(final Boolean modules, final Boolean artifacts); @Override boolean filter(Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields(); }
SearchFilter implements Filter { @Override public boolean filter(Object datamodelObj) { if(datamodelObj instanceof DbSearch){ return includeModules.equals(((DbSearch)datamodelObj).getModules() == null || ((DbSearch)datamodelObj).getModules().isEmpty()) && includeArtifacts.equals(((DbSearch)datamodelObj).getArtifacts() == null || ((DbSearch) datamodelObj).getArtifacts().isEmpty()); } return false; } SearchFilter(final Boolean modules, final Boolean artifacts); @Override boolean filter(Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields();  }