@Override public Notification newNotification() { return new NotificationImpl(); }
@Override public boolean equals(Object obj) { if ( this == obj ) return true; if ( !super.equals( obj ) ) return false; if ( !(obj instanceof EmailNotificationImpl) ) return false; EmailNotificationImpl other = (EmailNotificationImpl) obj; if ( emailHeaders == null ) { if ( other.emailHeaders != null ) return false; } else if ( !emailHeaders.equals( other.emailHeaders ) ) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((emailHeaders == null) ? 0 : emailHeaders.hashCode()); return result; }
@Override public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal( out ); if ( emailHeaders != null ) { out.writeInt( emailHeaders.size() ); for ( EmailNotificationHeader header : emailHeaders.values() ) { header.writeExternal( out ); } } else { out.writeInt( 0 ); } }
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal( in ); int size = in.readInt(); if ( size > 0 ) { emailHeaders = new HashMap<LanguageImpl, EmailNotificationHeaderImpl>(size); for ( int i = 0; i < size; i++ ) { EmailNotificationHeaderImpl header = new EmailNotificationHeaderImpl(); header.readExternal( in ); emailHeaders.put( new LanguageImpl(header.getLanguage()), header); } } }
@Override public void writeExternal(ObjectOutput out) throws IOException { super.writeExternal( out ); if ( emailHeaders != null ) { out.writeInt( emailHeaders.size() ); for ( EmailNotificationHeader header : emailHeaders.values() ) { header.writeExternal( out ); } } else { out.writeInt( 0 ); } }
@Override public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException { super.readExternal( in ); int size = in.readInt(); if ( size > 0 ) { emailHeaders = new HashMap<LanguageImpl, EmailNotificationHeaderImpl>(size); for ( int i = 0; i < size; i++ ) { EmailNotificationHeaderImpl header = new EmailNotificationHeaderImpl(); header.readExternal( in ); emailHeaders.put( new LanguageImpl(header.getLanguage()), header); } } }
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 NotificationImpl(); break; } case Email : { item = new EmailNotificationImpl(); break; } } item.readExternal( in ); list.add( item ); } return list; }
@Override public boolean equals(Object obj) { if ( this == obj ) return true; if ( !super.equals( obj ) ) return false; if ( !(obj instanceof EmailNotificationImpl) ) return false; EmailNotificationImpl other = (EmailNotificationImpl) obj; if ( emailHeaders == null ) { if ( other.emailHeaders != null ) return false; } else if ( !emailHeaders.equals( other.emailHeaders ) ) return false; return true; }
@Override public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((emailHeaders == null) ? 0 : emailHeaders.hashCode()); return result; }
@Override public Notification newNotification() { return new NotificationImpl(); }
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 NotificationImpl(); break; } case Email : { item = new EmailNotificationImpl(); break; } } item.readExternal( in ); list.add( item ); } return list; }