All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.softicar.platform.common.io.writer.IManagedPrintWriter Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.io.writer;

/**
 * This interface extends {@link IManagedWriter} with line printing methods.
 *
 * @author Oliver Richers
 */
public interface IManagedPrintWriter extends IManagedWriter {

	/**
	 * Calls {@link String#format(String, Object...)} and writes the result
	 * using {@link #write(CharSequence)}.
	 *
	 * @param format
	 *            the format {@link String} (never null)
	 * @param arguments
	 *            the formatting arguments (never null)
	 */
	default IManagedPrintWriter printf(String format, Object...arguments) {

		write(String.format(format, arguments));
		return this;
	}

	/**
	 * Prints a line separator.
	 */
	default IManagedPrintWriter println() {

		write(getLineSeparator());
		return this;
	}

	/**
	 * Calls {@link #printf(String, Object...)} and then {@link #println()}.
	 *
	 * @param format
	 *            the format {@link String} (never null)
	 * @param arguments
	 *            the formatting arguments (never null)
	 */
	default IManagedPrintWriter println(String format, Object...arguments) {

		printf(format, arguments);
		println();
		return this;
	}

	/**
	 * Returns the line separator of used by this {@link IManagedPrintWriter}.
	 *
	 * @return the line separator (never null)
	 */
	String getLineSeparator();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy