Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2010 JBoss Inc Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 
 package org.jbpm.services.task.impl.model;
 
 import java.util.Map;
 
 import  javax.persistence.CascadeType;
 import  javax.persistence.DiscriminatorValue;
 import  javax.persistence.Entity;
 import  javax.persistence.MapKeyColumn;
 import  javax.persistence.OneToMany;
 
 import  org.kie.internal.task.api.model.EmailNotificationHeader;
 import  org.kie.internal.task.api.model.Language;
 import  org.kie.internal.task.api.model.NotificationType;
 
 
 @Entity
 @DiscriminatorValue("EmailNotification")
 public class EmailNotificationImpl extends NotificationImpl implements org.kie.internal.task.api.model.EmailNotification{
 
     @OneToMany(cascade = CascadeType.ALL)
     @MapKeyColumn(name="mapkey")
     
     @Override
     public void writeExternal(ObjectOutput outthrows IOException {
         super.writeExternalout );
         if (  != null ) {
             out.writeInt.size() );
             for ( EmailNotificationHeader header : .values() ) {
                 header.writeExternal( out );
             }
         } else {
             out.writeInt( 0 );
         }
     }
     
     @Override
     public void readExternal(ObjectInput inthrows IOException,
                                             ClassNotFoundException {
         super.readExternalin );
         int size = in.readInt();
         if ( size > 0 ) {
              = new HashMap<LanguageImplEmailNotificationHeaderImpl>(size);
             for ( int i = 0; i < sizei++ ) {
                 EmailNotificationHeaderImpl header = new EmailNotificationHeaderImpl();
                 header.readExternalin );
                 .putnew LanguageImpl(header.getLanguage()), header);
             }
         }
     }
     
     public NotificationType getNotificationType() {
         return NotificationType.Email;
     }        
 
     public Map<? extends Language, ? extends EmailNotificationHeader> getEmailHeaders() {
         return ;
     }
 
     public void setEmailHeaders(Map<? extends Language, ? extends EmailNotificationHeader> emailHeaders) {
         this. = (Map<LanguageImplEmailNotificationHeaderImpl>) emailHeaders;
     }    
 
     @Override
     public int hashCode() {
         final int prime = 31;
         int result = super.hashCode();
         result = prime * result + (( == null) ? 0 : .hashCode());
         return result;
     }
 
     @Override
     public boolean equals(Object obj) {
         if ( this == obj ) return true;
         if ( !super.equalsobj ) ) return false;
         if ( !(obj instanceof EmailNotificationImpl) ) return false;
         EmailNotificationImpl other = (EmailNotificationImplobj;
         if (  == null ) {
             if ( other.emailHeaders != null ) return false;
        } else if ( !.equalsother.emailHeaders ) ) return false;
        return true;
    }    
    
    
    
New to GrepCode? Check out our FAQ X