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

org.javasimon.console.text.NoneStringifier Maven / Gradle / Ivy

There is a newer version: 4.2.0
Show newest version
package org.javasimon.console.text;

/**
 * Stringifier with particular meaning: do not stringify this value.
 * @author gquintana
 */
public class NoneStringifier implements Stringifier {
	private NoneStringifier() {
	}
	public String toString(T value) {
		throw new UnsupportedOperationException("Do not stringify");
	}
	private static final NoneStringifier INSTANCE=new NoneStringifier();
	/**
	 * Get unique instance of the NoneStringifier
	 */
	public static  NoneStringifier getInstance() {
		return (NoneStringifier) INSTANCE;
	}
	/**
	 * Check whether stringifier is the NoneStringifier
	 * @param stringifier Stringifier to compare with NoneStringifier
	 * @return null when stringifier==NoneStringifier, else given stringifier
	 */
	public static  Stringifier checkInstance(Stringifier stringifier) {
		return INSTANCE==stringifier?null:stringifier;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy