Creates a list of subject names in the given format with the given
size.

@param number Number of subjects to create.
@param stringFormat The format for subject names.
@return A list of subject names.
@throws ParameterException
188302
public static List<String> createSubjectList(int number, String stringFormat) {
                Validate.notNegative(number);
                Validate.notNull(stringFormat);
                List<String> result = new ArrayList<>(number);
                for (int i = 1; i <= number; i++) {
                        result.add(String.format(stringFormat, i));
                }
                return result;
        }
451349
public final ValueWithPos<String> formatUrl(final ValueWithPos<String> pphoneNumber) {
    return valueWithPosDefaults(this.formatUrlWithPos(this.parsePhoneNumber(pphoneNumber)),
        pphoneNumber);
  }
54107
public static String formatCompiledPattern(String compiledPattern, CharSequence... values) {
        return formatAndAppend(compiledPattern, new StringBuilder(), null, values).toString();
    }
174945
public List<Serializable> getValues(String text, String type) throws NumberFormatException {
        List<Serializable> list = new ArrayList<Serializable>();
        String[] values = text.split(DELIM);
        for (String v : values) {
            Serializable value;
            if (QueryParameter.INTEGER_VALUE.equals(type)) {
                value = Integer.parseInt(v);
            } else if (QueryParameter.BYTE_VALUE.equals(type)) {
                value = Byte.parseByte(v);
            } else if (QueryParameter.SHORT_VALUE.equals(type)) {
                value = Short.parseShort(v);
            } else if (QueryParameter.LONG_VALUE.equals(type)) {
                value = Long.parseLong(v);
            } else if (QueryParameter.FLOAT_VALUE.equals(type)) {
                value = Float.parseFloat(v);
            } else if (QueryParameter.DOUBLE_VALUE.equals(type)) {
                value = Double.parseDouble(v);
            } else if (QueryParameter.BIGDECIMAL_VALUE.equals(type)) {
                value = new BigDecimal(v);
            } else { // String
                value = v;
            }
            list.add(value);
        }
        
        return list;
    }
1229512
public static String format(double[][] m, NumberFormat nf) {
    return formatTo(new StringBuilder().append("[\n"), m, " [", "]\n", ", ", nf).append("]").toString();
  }
339939
public static QueryTemplate create(String name,
                                     Iterable<String> values,
                                     Charset charset,
                                     CollectionFormat collectionFormat) {
    if (Util.isBlank(name)) {
      throw new IllegalArgumentException("name is required.");
    }

    if (values == null) {
      throw new IllegalArgumentException("values are required");
    }

    /* remove all empty values from the array */
    Collection<String> remaining = StreamSupport.stream(values.spliterator(), false)
        .filter(Util::isNotBlank)
        .collect(Collectors.toList());

    StringBuilder template = new StringBuilder();
    Iterator<String> iterator = remaining.iterator();
    while (iterator.hasNext()) {
      template.append(iterator.next());
      if (iterator.hasNext()) {
        template.append(COLLECTION_DELIMITER);
      }
    }

    return new QueryTemplate(template.toString(), name, remaining, charset, collectionFormat);
  }
1211595
public static String getTitle(final String namePattern, final String methodName,
                                  final Object instance, final Object... parameters) {
        final String finalPattern = namePattern
                .replaceAll("\\{method}", methodName)
                .replaceAll("\\{this}", String.valueOf(instance));
        final int paramsCount = parameters == null ? 0 : parameters.length;
        final Object[] results = new Object[paramsCount];
        for (int i = 0; i < paramsCount; i++) {
            results[i] = arrayToString(parameters[i]);
        }

        return MessageFormat.format(finalPattern, results);
    }
800137
public NumberFormat getNumberFormat(char field) {
        Character ovrField;
        ovrField = Character.valueOf(field);
        if (overrideMap != null && overrideMap.containsKey(ovrField)) {
            String nsName = overrideMap.get(ovrField).toString();
            NumberFormat nf = numberFormatters.get(nsName);
            return nf;
        } else {
            return numberFormat;
        }
    }
685358
@Override
    public PactDslJsonBody eachLike(int numberExamples) {
      matchers.addRule(rootPath + appendArrayIndex(1), matchMin(0));
      PactDslJsonArray parent = new PactDslJsonArray(rootPath, "", this, true);
      parent.setNumberExamples(numberExamples);
      return new PactDslJsonBody(".", "", parent);
    }
104363
public void create(String string, Value value)
            throws DataFormatException {
        String[] strings = splitter.split(string);

        if (labels.length != strings.length) {
            if (formatIgnored) {
                throw new DataFormatException("input format error: " +
                                              "label.length = " + labels.length +
                                              ", input.lenght = " + strings.length);
            }
        }

        valueCreate(strings, value);
    }
1309985
public void init(TimeFormatType timeFormat, String datePattern, String numberPattern) {
		// Null
		final Stringifier nullStringifier = registerNullStringifier();

		// Default
		compositeStringifier.setDefaultStringifier(new BaseStringifier(nullStringifier));

		// String
		final Stringifier<String> stringStringifier = registerStringStringifier(nullStringifier);

		// Disabled String
		compositeStringifier.add(String.class, NONE_SUBTYPE, NoneStringifier.getInstance());

		// Integer
		final Stringifier<Integer> integerStringifier = new BaseStringifier<Integer>(nullStringifier) {

			@Override
			protected boolean isValid(Integer l) {
				return super.isValid(l) && !(l == Integer.MIN_VALUE || l == Integer.MAX_VALUE);
			}
		};
		compositeStringifier.add(Integer.class, integerStringifier);
		compositeStringifier.add(Integer.TYPE, integerStringifier);

		// Long
		final Stringifier<Long> longStringifier = new BaseStringifier<Long>(nullStringifier) {
			@Override
			protected boolean isValid(Long l) {
				return super.isValid(l) && !(l == Long.MIN_VALUE || l == Long.MAX_VALUE);
			}
		};
		registerLongStringifier(null, longStringifier);

		// Float
		final Stringifier<Float> floatStringifier = new NumberStringifier<Float>(nullStringifier, numberPattern) {
			@Override
			protected boolean isValid(Float f) {
				return super.isValid(f) && !(
					f == Float.MIN_VALUE || f == Float.MAX_VALUE || f.isInfinite() || f.isNaN());
			}
		};
		compositeStringifier.add(Float.class, floatStringifier);
		compositeStringifier.add(Float.TYPE, floatStringifier);

		// Double
		final Stringifier<Double> doubleStringifier = new NumberStringifier<Double>(nullStringifier, numberPattern) {
			@Override
			protected boolean isValid(Double d) {
				return super.isValid(d) && !(
					d == Double.MIN_VALUE || d == Double.MAX_VALUE || d.isInfinite() || d.isNaN());
			}
		};
		registerDoubleStringifier(null, doubleStringifier);

		// Enum
		final Stringifier<Enum> enumStringifier = new BaseStringifier<Enum>(nullStringifier) {
			@Override
			protected String doToString(Enum e) {
				return stringStringifier.toString(e.name());
			}
		};
		compositeStringifier.add(Enum.class, enumStringifier);
		compositeStringifier.add(SimonType.class, enumStringifier);
		compositeStringifier.add(SimonState.class, enumStringifier);
		compositeStringifier.add(HtmlResourceType.class, enumStringifier);

		// Date
		final Stringifier<java.util.Date> dateStringifier = new DateStringifier(nullStringifier, stringStringifier, datePattern);
		compositeStringifier.add(Date.class, dateStringifier);
		final LongDateStringifier longDateStringifier = new LongDateStringifier(nullStringifier, dateStringifier);
		registerLongStringifier(DATE_SUBTYPE, longDateStringifier);

		// Time
		final LongTimeStringifier longTimeStringifier = new LongTimeStringifier(nullStringifier, longStringifier, stringStringifier, timeFormat);
		registerLongStringifier(TIME_SUBTYPE, longTimeStringifier);
		final DoubleTimeStringifier doubleTimeStringifier = new DoubleTimeStringifier(nullStringifier, doubleStringifier, stringStringifier, timeFormat);
		registerDoubleStringifier(TIME_SUBTYPE, doubleTimeStringifier);

		// Boolean
		final Stringifier<Boolean> booleanStringifier = new BaseStringifier<Boolean>(nullStringifier) {
			@Override
			protected String doToString(Boolean b) {
				return stringStringifier.toString(b.toString());
			}
		};
		compositeStringifier.add(Boolean.class, booleanStringifier);
		compositeStringifier.add(Boolean.TYPE, booleanStringifier);
	}
233415
@GET
  @Path(PhoneNumber.PARSE_AND_FORMAT)
  public PhoneNumberDataWithFormats parseAndFormatPhoneNumber(
      @QueryParam(Parameters.LANGUAGE) final String planguage,
      @QueryParam(Parameters.COUNTRY) final String pcountry,
      @QueryParam(Parameters.PHONE_NUMBER) final String pphoneNumber) {
    final PhoneNumberDataWithFormats result = new PhoneNumberDataWithFormats(phoneNumberUtil
        .parsePhoneNumber(pphoneNumber, pcountry, LocaleUtil.convertLanguageToLocale(planguage)));
    result.setCommonInternational(phoneNumberUtil.formatCommonInternational(result));
    result.setCommonNational(phoneNumberUtil.formatCommonNational(result));
    result.setDin5008International(phoneNumberUtil.formatDin5008International(result));
    result.setDin5008National(phoneNumberUtil.formatDin5008National(result));
    result.setE123International(phoneNumberUtil.formatE123International(result));
    result.setE123National(phoneNumberUtil.formatE123National(result));
    result.setMs(phoneNumberUtil.formatMs(result));
    result.setUrl(phoneNumberUtil.formatUrl(result));
    return result;
  }
237068
public String format( String key, Object... params )
    {
        try
        {
            MessageFormat formatter = new MessageFormat( bundle.getString( key ) );
            return formatter.format( params );
        }
        catch (MissingResourceException ex)
        {
            return key;
        }
    }
1093313
public static Function<Object,List<String>> listOfString(final String methodName, final Object... optionalParameters) {
        return methodForListOfString(methodName, optionalParameters);
    }
995011
public String getPatternForNumItems(int count) {
        if (count <= 0) {
            throw new IllegalArgumentException("count must be > 0");
        }
        ArrayList<String> list = new ArrayList<String>();
        for (int i = 0; i < count; i++) {
            list.add(String.format("{%d}", i));
        }
        return format(list);
    }
567401
private static SimpleParameter[] createParameterArray(FormatChar formatChar) {
    SimpleParameter[] parameters = new SimpleParameter[MAX_CACHED_PARAMETERS];
    for (int index = 0; index < MAX_CACHED_PARAMETERS; index++) {
      parameters[index] = new SimpleParameter(index, formatChar, FormatOptions.getDefault());
    }
    return parameters;
  }
560855
private function getFormattingTemplate($numberPattern, $numberFormat)
    {
        // Creates a phone number consisting only of the digit 9 that matches the
        // numberPattern by applying the pattern to the longestPhoneNumber string.
        $longestPhoneNumber = '999999999999999';
        $m = new Matcher($numberPattern, $longestPhoneNumber);
        $m->find();
        $aPhoneNumber = $m->group();
        // No formatting template can be created if the number of digits entered entered so far
        // is longer than the maximum the current formatting rule can accommodate.
        if (mb_strlen($aPhoneNumber) < mb_strlen($this->nationalNumber)) {
            return '';
        }
        // Formats the number according to $numberFormat
        $template = preg_replace('/' . $numberPattern . '/' . PhoneNumberUtil::REGEX_FLAGS, $numberFormat, $aPhoneNumber);
        // Replaces each digit with character self::$digitPlattern
        $template = preg_replace('/9/', self::$digitPattern, $template);
        return $template;
    }