Java Code Examples for java.lang.String#format()

The following examples show how to use java.lang.String#format() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: UndertowServletLogger_$logger.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalArgumentException invalidRewriteFlags(final String line) {
    final IllegalArgumentException result = new IllegalArgumentException(String.format(getLoggingLocale(), invalidRewriteFlags1$str(), line));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 2
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalStateException notImplemented() {
    final IllegalStateException result = new IllegalStateException(String.format(getLoggingLocale(), notImplemented$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 3
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalStateException streamNotReady() {
    final IllegalStateException result = new IllegalStateException(String.format(getLoggingLocale(), streamNotReady$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 4
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalStateException moreThanOneDefaultErrorPage(final String defaultErrorPage, final String location) {
    final IllegalStateException result = new IllegalStateException(String.format(getLoggingLocale(), moreThanOneDefaultErrorPage$str(), defaultErrorPage, location));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 5
Source File: UndertowServletLogger_$logger.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalArgumentException invalidRewriteFlags(final String line, final String flags) {
    final IllegalArgumentException result = new IllegalArgumentException(String.format(getLoggingLocale(), invalidRewriteFlags2$str(), line, flags));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 6
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IOException deleteFailed(final Path file) {
    final IOException result = new IOException(String.format(getLoggingLocale(), deleteFailed$str(), file));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 7
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalStateException streamNotInAsyncMode() {
    final IllegalStateException result = new IllegalStateException(String.format(getLoggingLocale(), streamNotInAsyncMode$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 8
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final ServletException couldNotInstantiateComponent(final String name, final Exception e) {
    final ServletException result = new ServletException(String.format(getLoggingLocale(), couldNotInstantiateComponent$str(), name), e);
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 9
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IOException streamIsClosed() {
    final IOException result = new IOException(String.format(getLoggingLocale(), streamIsClosed$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 10
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final ServletException userAlreadyLoggedIn() {
    final ServletException result = new ServletException(String.format(getLoggingLocale(), userAlreadyLoggedIn$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 11
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalArgumentException cannotAddServletContextListener() {
    final IllegalArgumentException result = new IllegalArgumentException(String.format(getLoggingLocale(), cannotAddServletContextListener$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 12
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final NullPointerException nullName() {
    final NullPointerException result = new NullPointerException(String.format(getLoggingLocale(), nullName$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 13
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalArgumentException headerCannotBeConvertedToDate(final String header) {
    final IllegalArgumentException result = new IllegalArgumentException(String.format(getLoggingLocale(), headerCannotBeConvertedToDate$str(), header));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 14
Source File: OptimizelyBenchmark.java    From java-sdk with Apache License 2.0 5 votes vote down vote up
@Setup
@SuppressFBWarnings(value="OBL_UNSATISFIED_OBLIGATION_EXCEPTION_EDGE", justification="stream is safely closed")
public void setup() throws IOException, ConfigParseException {
    Properties properties = new Properties();
    InputStream propertiesStream = getClass().getResourceAsStream("/benchmark.properties");
    properties.load(propertiesStream);
    propertiesStream.close();

    String datafilePathTemplate = properties.getProperty("datafilePathTemplate");
    String datafilePath = String.format(datafilePathTemplate, numExperiments);

    String activateGroupExperimentPropTemplate = properties.getProperty("activateGroupExperimentUserIdPropTemplate");
    activateGroupExperimentUserId = properties.getProperty(
            String.format(activateGroupExperimentPropTemplate, numExperiments));

    String activateGroupExperimentAttributesPropTemplate =
            properties.getProperty("activateGroupExperimentAttributesUserIdPropTemplate");
    activateGroupExperimentAttributesUserId = properties.getProperty(
            String.format(activateGroupExperimentAttributesPropTemplate, numExperiments));

    String trackGroupExperimentPropTemplate = properties.getProperty("trackGroupExperimentUserIdPropTemplate");
    trackGroupExperimentUserId = properties.getProperty(
            String.format(trackGroupExperimentPropTemplate, numExperiments));

    String trackGroupExperimentAttributesPropTemplate =
            properties.getProperty("trackGroupExperimentAttributesUserIdPropTemplate");
    trackGroupExperimentAttributesUserId = properties.getProperty(
            String.format(trackGroupExperimentAttributesPropTemplate, numExperiments));

    optimizely = Optimizely.builder(BenchmarkUtils.getProfilingDatafile(datafilePath),
                                    new NoopEventHandler()).build();
}
 
Example 15
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalStateException asyncAlreadyStarted() {
    final IllegalStateException result = new IllegalStateException(String.format(getLoggingLocale(), asyncAlreadyStarted$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 16
Source File: IlluminaBasecallingMetrics.java    From picard with MIT License 5 votes vote down vote up
@Override
public String toString() {
    return String.format("IlluminaBasecallingMetric(Lane:%s,Barcode:%s,Name:%s,MEAN_CLUSTERS_PER_TILE:%s,SD_CLUSTERS_PER_TILE:%s," +
                          "MEAN_PCT_PF_CLUSTERS_PER_TILE:%s,SD_PCT_PF_CLUSTERS_STD_PER_TILE:%s," +
                          "MEAN_PF_CLUSTERS_PER_TILE:%s,SD_PF_CLUSTERS_PER_TILE:%s",
            LANE
            ,MOLECULAR_BARCODE_SEQUENCE_1
            ,MOLECULAR_BARCODE_NAME
            ,MEAN_CLUSTERS_PER_TILE
            ,SD_CLUSTERS_PER_TILE
            ,MEAN_PCT_PF_CLUSTERS_PER_TILE
            ,SD_PCT_PF_CLUSTERS_PER_TILE
            ,MEAN_PF_CLUSTERS_PER_TILE
            ,SD_PF_CLUSTERS_PER_TILE);
}
 
Example 17
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalStateException servletContextAlreadyInitialized() {
    final IllegalStateException result = new IllegalStateException(String.format(getLoggingLocale(), servletContextAlreadyInitialized$str()));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 18
Source File: SQLiteUtils.java    From clear-todolist with GNU General Public License v3.0 5 votes vote down vote up
public static String createTableDefinition(TableInfo tableInfo) {
	final ArrayList<String> definitions = new ArrayList<String>();

	for (Field field : tableInfo.getFields()) {
		String definition = createColumnDefinition(tableInfo, field);
		if (!TextUtils.isEmpty(definition)) {
			definitions.add(definition);
		}
	}

	definitions.addAll(createUniqueDefinition(tableInfo));

	return String.format("CREATE TABLE IF NOT EXISTS %s (%s);", tableInfo.getTableName(),
			TextUtils.join(", ", definitions));
}
 
Example 19
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalStateException canOnlyRemoveDeploymentsWhenUndeployed(final State state) {
    final IllegalStateException result = new IllegalStateException(String.format(getLoggingLocale(), canOnlyRemoveDeploymentsWhenUndeployed$str(), state));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}
 
Example 20
Source File: UndertowServletMessages_$bundle.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@Override
public final IllegalArgumentException paramCannotBeNull(final String param, final String componentType, final String name) {
    final IllegalArgumentException result = new IllegalArgumentException(String.format(getLoggingLocale(), paramCannotBeNull3$str(), param, componentType, name));
    final StackTraceElement[] st = result.getStackTrace();
    result.setStackTrace(Arrays.copyOfRange(st, 1, st.length));
    return result;
}