src/main/java/pityoulish/mbserver/StringProblemFactory.java
public static String te2string(TextEntry te, Object... params)
  {
    if (te == null)
       throw new NullPointerException("TextEntry");

    String result = null;

    if (te.getParamCount() < 0)
     {
       // plain text lookup, no parameters allowed
       if (params.length > 0)
          throw new IllegalArgumentException("params");
       result = te.lookup();
     }
    else
     {
       // parameter count is checked by the formatting method
       result = te.format(params);
     }

    return result;
  }
/**
   * Formats a text entry with optional parameters into a string.
   * This method might be useful for other, non-string problem factories too.
   *
   * @param te       a text entry that describes the validation problem
   * @param params   the parameters to be formatted by the text entry
   *
   * @return   a string generated from the arguments
   */
Formats a text entry with optional parameters into a string.
This method might be useful for other, non-string problem factories too.

@param te       a text entry that describes the validation problem
@param params   the parameters to be formatted by the text entry

@return   a string generated from the arguments
Formats a text entry with optional parameters into a string . This method might be useful for other non - string problem factories too . @param te a text entry that describes the validation problem @param params the parameters to be formatted by the text entry @return a string generated from the arguments
public static String te2string(TextEntry te, Object... params)
  {
    if (te == null)
       throw new NullPointerException("TextEntry");
    String result = null;
    if (te.getParamCount() < 0)
     {
       if (params.length > 0)
          throw new IllegalArgumentException("params");
       result = te.lookup();
     }
    else
     {
       result = te.format(params);
     }
    return result;
  }
public static String te2string ( TextEntry te , Object ... params ) { if ( te == null ) throw new NullPointerException ( "TextEntry" ) ; String result = null ; if ( te . getParamCount ( ) < 0 ) { if ( params . length > 0 ) throw new IllegalArgumentException ( "params" ) ; result = te . lookup ( ) ; } else { result = te . format ( params ) ; } return result ; }
Formats a text entry with optional parameters into a string.
Formats a text entry with optional parameters into a string .
// plain text lookup, no parameters allowed // parameter count is checked by the formatting method