protected FaultsModel toFaultsModel ( Fault [ ] faults , KnowledgeNamespace knowledgeNamespace ) { FaultsModel faultsModel = null ; if ( faults != null ) { for ( Fault fault : faults ) { if ( fault != null ) { FaultModel faultModel = new V1FaultModel ( knowledgeNamespace . uri ( ) ) ; String from = fault . from ( ) ; if ( ! UNDEFINED . equals ( from ) ) { faultModel . setFrom ( from ) ; } String to = fault . to ( ) ; if ( ! UNDEFINED . equals ( to ) ) { faultModel . setTo ( to ) ; } if ( faultsModel == null ) { faultsModel = new V1FaultsModel ( knowledgeNamespace . uri ( ) ) ; } faultsModel . addFault ( faultModel ) ; } } } return faultsModel ; }
Converts faults to mappings model .