For IntelliJ IDEA and
Android Studio


/** * Checks to see if a dimensional item object has values * stored in the database by attribute option combo. * * @param o dimensional item object * @return true if values are stored by attribuete option combo. */ private boolean hasAttributeOptions( DimensionalItemObject o ) { return o.getDimensionItemType() != DimensionItemType.PROGRAM_INDICATOR || ( (ProgramIndicator)o ).getAnalyticsType() != AnalyticsType.ENROLLMENT; }
@Override public Map<ProgramIndicator, String> getInvalidProgramIndicatorExpressions() { Map<ProgramIndicator, String> invalidExpressions = new HashMap<>(); invalidExpressions = programIndicatorService.getAllProgramIndicators().stream() .filter( pi -> ! ProgramIndicator.VALID.equals( programIndicatorService.expressionIsValid( pi.getExpression() ) ) ) .collect( Collectors.toMap( pi -> pi, pi -> pi.getExpression() ) ); return invalidExpressions; }
@Override public int hashCode() { int result = id; result = 31 * result + (programIndicator != null ? programIndicator.hashCode() : 0); result = 31 * result + (legendSet != null ? legendSet.hashCode() : 0); result = 31 * result + (filter != null ? filter.hashCode() : 0); return result; }
@Override public void deleteProgramIndicator( ProgramIndicator programIndicator) { for ( ProgramIndicatorGroup group : programIndicator.getGroups() ) { group.getMembers().remove( programIndicator ); programIndicatorService.updateProgramIndicatorGroup( group ); } } }
public void addProgramIndicator( ProgramIndicator programIndicator ) { members.add( programIndicator ); programIndicator.getGroups().add( this ); }
@Override @Transactional public int addProgramIndicator( ProgramIndicator programIndicator ) { programIndicatorStore.save( programIndicator ); return programIndicator.getId(); }
public String getDisplayName() { return programIndicator != null ? programIndicator.getDisplayName() : null; }
public String getUid() { return programIndicator != null ? programIndicator.getUid() : null; }
@Override public Map<ProgramIndicator, String> getInvalidProgramIndicatorFilters() { Map<ProgramIndicator, String> invalidFilters = new HashMap<>(); invalidFilters = programIndicatorService.getAllProgramIndicators().stream() .filter( pi -> ( ! ( pi.hasFilter() ? ProgramIndicator.VALID.equals( programIndicatorService.filterIsValid( pi.getFilter() ) ) : true ) ) ) .collect( Collectors.toMap( pi -> pi, pi -> pi.getFilter() ) ); return invalidFilters; } }
public static ProgramIndicator createProgramIndicator( char uniqueCharacter, Program program, String expression, String filter ) { ProgramIndicator indicator = new ProgramIndicator(); indicator.setAutoFields(); indicator.setName( "Indicator" + uniqueCharacter ); indicator.setShortName( "IndicatorShort" + uniqueCharacter ); indicator.setCode( "IndicatorCode" + uniqueCharacter ); indicator.setDescription( "IndicatorDescription" + uniqueCharacter ); indicator.setProgram( program ); indicator.setExpression( expression ); indicator.setFilter( filter ); return indicator; }
public void updateIndicatorGroups( Set<ProgramIndicatorGroup> updates ) { for ( ProgramIndicatorGroup group : new HashSet<>( groups ) ) { if ( !updates.contains( group ) ) { removeIndicatorGroup( group ); } } for ( ProgramIndicatorGroup group : updates ) { addProgramIndicatorGroup( group ); } }
public boolean hasEnrollmentProgramIndicatorDimension() { return programIndicator != null && AnalyticsType.ENROLLMENT.equals( programIndicator.getAnalyticsType() ); }
public void removeProgramIndicator( ProgramIndicator indicator ) { members.remove( indicator ); indicator.getGroups().remove( this ); }
public boolean hasEventProgramIndicatorDimension() { return programIndicator != null && AnalyticsType.EVENT.equals( programIndicator.getAnalyticsType() ); }
/** * Checks to see if a dimensional item object has values * stored in the database by attribute option combo. * * @param o dimensional item object * @return true if values are stored by attribuete option combo. */ private boolean hasAttributeOptions( DimensionalItemObject o ) { return o.getDimensionItemType() != DimensionItemType.PROGRAM_INDICATOR || ( (ProgramIndicator)o ).getAnalyticsType() != AnalyticsType.ENROLLMENT; }