Raj,
For WaveItem, we must use {} to allow them to detect generic type at runtime (Diamond operator don't work with anonymous class); I didn't find a more concise way to define type contract.
So the right declaration is:
WaveItem<Collection<Bean>> WAVE_ITEM_NAME = new WaveItem<Collection<Bean>>
(){};
WaveType can be built with 6 different ways:
WaveTypeBase.build("WAVE_TYPE_NAME");
WaveTypeBase.build("WAVE_TYPE_NAME", WAVE_ITEM_NAME);
WaveTypeBase.build("WAVE_TYPE_NAME", WAVE_ITEM_NAME1, WAVE_ITEM_NAME2, WAVE_ITEM_NAME3);
WaveTypeBase.build("WAVE_TYPE_NAME", RETURN_WAVE_TYPE);
WaveTypeBase.build("WAVE_TYPE_NAME", RETURN_WAVE_TYPE, WAVE_ITEM_NAME);
WaveTypeBase.build("WAVE_TYPE_NAME", RETURN_WAVE_TYPE, WAVE_ITEM_NAME1, WAVE_ITEM_NAME2, WAVE_ITEM_NAME3);
The return wave type is used as an asynchronous call back wave.
WaveItem and WaveType were created with the idea that we can use it throught Enum classes, but I' m about to leave this feature and simplify API by removing the WaveType interface.
Seb