public SoyMsgBundle compact ( SoyMsgBundle input ) { ImmutableList . Builder < SoyMsg > builder = ImmutableList . builder ( ) ; for ( SoyMsg msg : input ) { ImmutableList < SoyMsgPart > parts = compactParts ( msg . getParts ( ) ) ; builder . add ( SoyMsg . builder ( ) . setId ( msg . getId ( ) ) . setLocaleString ( msg . getLocaleString ( ) ) . setIsPlrselMsg ( MsgPartUtils . hasPlrselPart ( parts ) ) . setParts ( parts ) . build ( ) ) ; } return new RenderOnlySoyMsgBundleImpl ( input . getLocaleString ( ) , builder . build ( ) ) ; }
Returns a more memory - efficient version of the internal message bundle .