/* * * Copyright (c) 19** - 2*** Tomas Bubenik. All Rights Reserved. * */ package info.bubeniktomas; import java.io.ObjectStreamException; import java.io.Serializable; /** * Tomas Bubenik's sample final singleton instance well-commented class. * * @version 1.0 19 Oct 1975 * @author Tomas Bubenik */ public class BubenikTomas implements Serializable { /** Generated serial version UID. */ private static final long serialVersionUID = 403698208635039827L; /** Final singleton instance. */ private static final BubenikTomas INSTANCE = new BubenikTomas(); /** Final message. */ private static final String MESSAGE = "This is Tomas Bubenik's sample" + " final singleton instance well-commented class.\r\nAll other software by Tomas" + " Bubenik is paid.\r\nSend your order to bubenik.tomas@gmail.com."; /** * Private constructor method. * * This constructor suppresses initial constructor. */ private BubenikTomas() { // This constructor will never be called externally! } /** * Main (message) method. * * @param args arguments */ public static void main(String[] args) { System.out.println(MESSAGE); } /** * Get final singleton instance method. */ public static BubenikTomas getInstance() { return INSTANCE; } /** * ReadResolve final singleton instance method. */ private Object readResolve() throws ObjectStreamException { return INSTANCE; } }