Coverage Report - org.kuali.student.core.messages.service.impl.MessageAssembler
 
Classes in this File Line Coverage Branch Coverage Complexity
MessageAssembler
0%
0/18
0%
0/2
1.333
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation Licensed under the
 3  
  * Educational Community License, Version 2.0 (the "License"); you may
 4  
  * not use this file except in compliance with the License. You may
 5  
  * obtain a copy of the License at
 6  
  *
 7  
  * http://www.osedu.org/licenses/ECL-2.0
 8  
  *
 9  
  * Unless required by applicable law or agreed to in writing,
 10  
  * software distributed under the License is distributed on an "AS IS"
 11  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 12  
  * or implied. See the License for the specific language governing
 13  
  * permissions and limitations under the License.
 14  
  */
 15  
 
 16  
 package org.kuali.student.core.messages.service.impl;
 17  
 
 18  
 import java.util.ArrayList;
 19  
 import java.util.List;
 20  
 
 21  
 import org.apache.log4j.Logger;
 22  
 import org.kuali.student.common.messages.dto.Message;
 23  
 import org.kuali.student.core.messages.entity.MessageEntity;
 24  
 
 25  0
 public class MessageAssembler {
 26  
 
 27  0
     final static Logger logger = Logger.getLogger(MessageAssembler.class);
 28  
     
 29  
         public static void toMessageEntity(Message message,
 30  
                         MessageEntity messageEntity) {
 31  0
                 messageEntity.setGroupName(message.getGroupName());
 32  0
                 messageEntity.setMessageId(message.getId());
 33  0
                 messageEntity.setLocale(message.getLocale());
 34  0
                 messageEntity.setValue(message.getValue());
 35  0
         }
 36  
 
 37  
         public static void toMessage(MessageEntity messageEntity, Message message) {
 38  0
                 message.setGroupName(messageEntity.getGroupName());
 39  0
                 message.setId(messageEntity.getMessageId());
 40  0
                 message.setLocale(messageEntity.getLocale());
 41  0
                 message.setValue(messageEntity.getValue());
 42  0
         }
 43  
 
 44  
         public static List<Message> toMessageList(List<MessageEntity> messages,
 45  
                         Class<Message> message) {
 46  0
                 List<Message> result = new ArrayList<Message>();
 47  0
                 Message m1 = new Message();
 48  0
                 for (MessageEntity e : messages) {
 49  0
                         toMessage(e, m1);
 50  0
                         result.add(m1);
 51  
                 }
 52  0
                 return result;
 53  
 
 54  
         }
 55  
 }