public List<MType> build(){
  isClean=true;
  if (!isMessagesListMutable && builders == null) {
    return messages;
  }
  boolean allMessagesInSync=true;
  if (!isMessagesListMutable) {
    for (int i=0; i < messages.size(); i++) {
      Message message=messages.get(i);
      SingleFieldBuilder<MType,BType,IType> builder=builders.get(i);
      if (builder != null) {
        if (builder.build() != message) {
          allMessagesInSync=false;
          break;
        }
      }
    }
    if (allMessagesInSync) {
      return messages;
    }
  }
  ensureMutableMessageList();
  for (int i=0; i < messages.size(); i++) {
    messages.set(i,getMessage(i,true));
  }
  messages=Collections.unmodifiableList(messages);
  isMessagesListMutable=false;
  return messages;
}

public List < MType > build ( ) { isClean = true ; if ( ! isMessagesListMutable && builders == null ) { return messages ; } boolean allMessagesInSync = true ; if ( ! isMessagesListMutable ) { for ( int i = 0 ; i < messages . size ( ) ; i ++ ) { Message message = messages . get ( i ) ; SingleFieldBuilder < MType , BType , IType > builder = builders . get ( i ) ; if ( builder != null ) { if ( builder . build ( ) != message ) { allMessagesInSync = false ; break ; } } } if ( allMessagesInSync ) { return messages ; } } ensureMutableMessageList ( ) ; for ( int i = 0 ; i < messages . size ( ) ; i ++ ) { messages . set ( i , getMessage ( i , true ) ) ; } messages = Collections . unmodifiableList ( messages ) ; isMessagesListMutable = false ; return messages ; }
builds the list of messages from the builder and returns them .
