public MyEntitiesValidationReport addAttribute ( String attributeName , AttributeState state ) { if ( getImportOrder ( ) . isEmpty ( ) ) { throw new IllegalStateException ( "Must add entity first" ) ; } String entityTypeId = getImportOrder ( ) . get ( getImportOrder ( ) . size ( ) - 1 ) ; valid = valid && state . isValid ( ) ; switch ( state ) { case IMPORTABLE : addField ( fieldsImportable , entityTypeId , attributeName ) ; break ; case UNKNOWN : addField ( fieldsUnknown , entityTypeId , attributeName ) ; break ; case AVAILABLE : addField ( fieldsAvailable , entityTypeId , attributeName ) ; break ; case REQUIRED : addField ( fieldsRequired , entityTypeId , attributeName ) ; break ; default : throw new UnexpectedEnumException ( state ) ; } return this ; }
Creates a new report with an attribute added to the last added entity ;