Ways of creating WaveItem and WaveType

16 views
Skip to first unread message

Rajmahendra R

unread,
Jul 19, 2013, 1:17:34 AM7/19/13
to jrebirth-...@googlegroups.com
Seb

What are the ways we can create WaveItem and WaveTypes ?  What is see from examples are...


WaveItem

WaveItem<Collection<Bean>> WAVE_ITEM_NAME = new WaveItem<Collection<Bean>>();

WaveItem<Bean> WAVE_ITEM_NAME = new WaveItem<Bean>()

WaveType

 WaveType WAVE_TYPE_NAME = WaveTypeBase.build("WAVE_TYPE_NAME", WAVE_ITEM_NAME);

WaveType WAVE_TYPE_NAME = WaveTypeBase.build("WAVE_TYPE_NAME");

Sebastien Bordes

unread,
Jul 19, 2013, 4:05:29 AM7/19/13
to jrebirth-...@googlegroups.com
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
Reply all
Reply to author
Forward
0 new messages