public String printToString(MessageOrBuilder message){
  StringBuilder result=new StringBuilder();
  for (  FieldDescriptor field : getFieldsInNumberOrder(message.getDescriptorForType())) {
    if (field.isRepeated() && message.getRepeatedFieldCount(field) == 0 || !field.isRepeated() && !message.hasField(field)) {
      continue;
    }
    Object rawValue=message.getField(field);
    @SuppressWarnings("unchecked") List<Object> values=field.isMapField() ? sortMapEntries(field,rawValue) : field.isRepeated() ? (List<Object>)rawValue : ImmutableList.of(rawValue);
    for (    Object value : values) {
      result.append(printFieldToString(field,value));
    }
  }
  return result.toString();
}

public String printToString ( MessageOrBuilder message ) { StringBuilder result = new StringBuilder ( ) ; for ( FieldDescriptor field : getFieldsInNumberOrder ( message . getDescriptorForType ( ) ) ) { if ( field . isRepeated ( ) && message . getRepeatedFieldCount ( field ) == 0 || ! field . isRepeated ( ) && ! message . hasField ( field ) ) { continue ; } Object rawValue = message . getField ( field ) ; @ SuppressWarnings ( "unchecked" ) List < Object > values = field . isMapField ( ) ? sortMapEntries ( field , rawValue ) : field . isRepeated ( ) ? ( List < Object > ) rawValue : ImmutableList . of ( rawValue ) ; for ( Object value : values ) { result . append ( printFieldToString ( field , value ) ) ; } } return result . toString ( ) ; }
converts a message into a string .
