@Test public void approveArtifact(){ final DbArtifact doNotUseArtifact = new DbArtifact(); doNotUseArtifact.setDoNotUse(true); final DbArtifact artifactThatCanBeUsed = new DbArtifact(); artifactThatCanBeUsed.setDoNotUse(false); DoNotUseFilter filter = new DoNotUseFilter(true); assertTrue(filter.filter(doNotUseArtifact)); assertFalse(filter.filter(artifactThatCanBeUsed)); filter = new DoNotUseFilter(false); assertFalse(filter.filter(doNotUseArtifact)); assertTrue(filter.filter(artifactThatCanBeUsed)); }
@Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return doNotUse.equals( ((DbArtifact)datamodelObj).getDoNotUse()); } return false; }
DoNotUseFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return doNotUse.equals( ((DbArtifact)datamodelObj).getDoNotUse()); } return false; } }
DoNotUseFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return doNotUse.equals( ((DbArtifact)datamodelObj).getDoNotUse()); } return false; } DoNotUseFilter(final Boolean doNotUse); }
DoNotUseFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return doNotUse.equals( ((DbArtifact)datamodelObj).getDoNotUse()); } return false; } DoNotUseFilter(final Boolean doNotUse); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields(); }
DoNotUseFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbArtifact){ return doNotUse.equals( ((DbArtifact)datamodelObj).getDoNotUse()); } return false; } DoNotUseFilter(final Boolean doNotUse); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields();  }