Map<String, Pattern52> uniquePatterns = new HashMap<String, Pattern52>();
if ( legacyDTModel.conditionCols != null ) {
for ( int i = 0; i < legacyDTModel.conditionCols.size(); i++ ) {
ConditionCol c = legacyDTModel.conditionCols.get( i );
String boundName = c.boundName;
Pattern52 p = uniquePatterns.get( boundName );
if ( p == null ) {
p = new Pattern52();
p.setBoundName( boundName );
p.setFactType( c.factType );
patterns.add( p );
uniquePatterns.put( boundName,
p );
}
if ( p.getFactType() != null && !p.getFactType().equals( c.factType ) ) {
throw new IllegalArgumentException( "Inconsistent FactTypes for ConditionCols bound to '" + boundName + "' detected." );
}
p.getChildColumns().add( makeNewColumn( c ) );
}
for ( Pattern52 p : patterns ) {
newDTModel.getConditions().add( p );
}
}