package com.croftsoft.apps.exemplar; import com.croftsoft.core.lang.NullArgumentException; /********************************************************************* * Exemplar enumerated type message. * * Use to pass messages between the model, view, and controller. * * @version * $Id: Message.java,v 1.1 2006/06/22 13:38:21 croft Exp $ * @since * 2006-06-22 * @author * David Wallace Croft *********************************************************************/ public final class Message ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// { public static final Message CLICK_COUNT_CHANGED_INSTANCE = new Message ( Type.CLICK_COUNT_CHANGED ), INCREMENT_CLICK_COUNT_INSTANCE = new Message ( Type.INCREMENT_CLICK_COUNT ); // public enum Type { CLICK_COUNT_CHANGED, INCREMENT_CLICK_COUNT; } // private final Type type; private final Object content; ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// public Message ( final Type type, final Object content ) ////////////////////////////////////////////////////////////////////// { NullArgumentException.check ( this.type = type ); this.content = content; } public Message ( final Type type ) ////////////////////////////////////////////////////////////////////// { this ( type, null ); } ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// public Type getType ( ) { return type; } public Object getContent ( ) { return content; } ////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////// }