public static List<Notification> readNotificationList(ObjectInput in) throws IOException, ClassNotFoundException {
int size = in.readInt();
List<Notification> list = new ArrayList<Notification>(size);
for ( int i = 0; i < size; i++ ) {
Notification item = null;
switch( NotificationType.valueOf( in.readUTF() ) ) {
case Default : {
item = new Notification();
break;
}
case Email : {
item = new EmailNotification();
break;
}
}
item.readExternal( in );
list.add( item );
}
return list;
}