001 package com.croftsoft.apps.exemplar; 002 003 import com.croftsoft.core.lang.NullArgumentException; 004 005 /*********************************************************************** 006 * Exemplar enumerated type message. 007 * 008 * Use to pass messages between the model, view, and controller. 009 * 010 * @version 011 * $Id: ExemplarMessage.java,v 1.4 2008/02/15 22:38:03 croft Exp $ 012 * @since 013 * 2006-06-22 014 * @author 015 * <a href="https://www.croftsoft.com/">David Wallace Croft</a> 016 ***********************************************************************/ 017 018 public final class ExemplarMessage 019 //////////////////////////////////////////////////////////////////////// 020 //////////////////////////////////////////////////////////////////////// 021 { 022 023 public static final ExemplarMessage 024 CLICK_COUNT_CHANGED_INSTANCE 025 = new ExemplarMessage ( Type.CLICK_COUNT_CHANGED ), 026 INCREMENT_CLICK_COUNT_INSTANCE 027 = new ExemplarMessage ( Type.INCREMENT_CLICK_COUNT ); 028 029 // 030 031 public enum Type 032 { 033 CLICK_COUNT_CHANGED, 034 INCREMENT_CLICK_COUNT; 035 } 036 037 // 038 039 private final Type type; 040 041 private final Object content; 042 043 //////////////////////////////////////////////////////////////////////// 044 //////////////////////////////////////////////////////////////////////// 045 046 public ExemplarMessage ( 047 final Type type, 048 final Object content ) 049 //////////////////////////////////////////////////////////////////////// 050 { 051 NullArgumentException.check ( this.type = type ); 052 053 this.content = content; 054 } 055 056 public ExemplarMessage ( final Type type ) 057 //////////////////////////////////////////////////////////////////////// 058 { 059 this ( type, null ); 060 } 061 062 //////////////////////////////////////////////////////////////////////// 063 //////////////////////////////////////////////////////////////////////// 064 065 public Type getType ( ) { return type; } 066 067 public Object getContent ( ) { return content; } 068 069 //////////////////////////////////////////////////////////////////////// 070 //////////////////////////////////////////////////////////////////////// 071 }