@Test public void promotedArtifact(){ final DbArtifact promotedArtifact = new DbArtifact(); promotedArtifact.setPromoted(true); final DbArtifact notPromotedArtifact = new DbArtifact(); notPromotedArtifact.setPromoted(false); PromotedFilter filter = new PromotedFilter(true); assertTrue(filter.filter(promotedArtifact)); assertFalse(filter.filter(notPromotedArtifact)); filter = new PromotedFilter(false); assertFalse(filter.filter(promotedArtifact)); assertTrue(filter.filter(notPromotedArtifact)); }
@Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbModule){ return promoted.equals( ((DbModule)datamodelObj).isPromoted()); } if(datamodelObj instanceof DbArtifact){ return promoted.equals( ((DbArtifact)datamodelObj).isPromoted()); } return false; }
PromotedFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbModule){ return promoted.equals( ((DbModule)datamodelObj).isPromoted()); } if(datamodelObj instanceof DbArtifact){ return promoted.equals( ((DbArtifact)datamodelObj).isPromoted()); } return false; } }
PromotedFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbModule){ return promoted.equals( ((DbModule)datamodelObj).isPromoted()); } if(datamodelObj instanceof DbArtifact){ return promoted.equals( ((DbArtifact)datamodelObj).isPromoted()); } return false; } PromotedFilter(final Boolean promoted); }
PromotedFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbModule){ return promoted.equals( ((DbModule)datamodelObj).isPromoted()); } if(datamodelObj instanceof DbArtifact){ return promoted.equals( ((DbArtifact)datamodelObj).isPromoted()); } return false; } PromotedFilter(final Boolean promoted); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields(); }
PromotedFilter implements Filter { @Override public boolean filter(final Object datamodelObj) { if(datamodelObj instanceof DbModule){ return promoted.equals( ((DbModule)datamodelObj).isPromoted()); } if(datamodelObj instanceof DbArtifact){ return promoted.equals( ((DbArtifact)datamodelObj).isPromoted()); } return false; } PromotedFilter(final Boolean promoted); @Override boolean filter(final Object datamodelObj); @Override Map<String, Object> moduleFilterFields(); @Override Map<String, Object> artifactFilterFields();  }