@Test public void approveNull(){ LicenseIdFilter filter = new LicenseIdFilter("test"); assertFalse(filter.filter(null)); }
@Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbLicense){ return licenseId.equals( ((DbLicense)datamodelObj).getName()); } if(datamodelObj instanceof DbArtifact){ return ((DbArtifact)datamodelObj).getLicenses().contains(licenseId); } return false; }
LicenseIdFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbLicense){ return licenseId.equals( ((DbLicense)datamodelObj).getName()); } if(datamodelObj instanceof DbArtifact){ return ((DbArtifact)datamodelObj).getLicenses().contains(licenseId); } return false; } }
LicenseIdFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbLicense){ return licenseId.equals( ((DbLicense)datamodelObj).getName()); } if(datamodelObj instanceof DbArtifact){ return ((DbArtifact)datamodelObj).getLicenses().contains(licenseId); } return false; } LicenseIdFilter(final String licenseId); }
LicenseIdFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbLicense){ return licenseId.equals( ((DbLicense)datamodelObj).getName()); } if(datamodelObj instanceof DbArtifact){ return ((DbArtifact)datamodelObj).getLicenses().contains(licenseId); } return false; } LicenseIdFilter(final String licenseId); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields(); }
LicenseIdFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbLicense){ return licenseId.equals( ((DbLicense)datamodelObj).getName()); } if(datamodelObj instanceof DbArtifact){ return ((DbArtifact)datamodelObj).getLicenses().contains(licenseId); } return false; } LicenseIdFilter(final String licenseId); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields();  }