Coverage Report - org.kuali.student.r2.core.search.dto.SearchResultRowInfo
 
Classes in this File Line Coverage Branch Coverage Complexity
SearchResultRowInfo
0%
0/16
0%
0/6
1.5
 
 1  
 /**
 2  
  * Copyright 2010 The Kuali Foundation 
 3  
  *
 4  
  * Licensed under the Educational Community License, Version 2.0 (the
 5  
  * "License"); you may not use this file except in compliance with the
 6  
  * License. You may obtain a copy of the License at
 7  
  *
 8  
  * http://www.osedu.org/licenses/ECL-2.0
 9  
  *
 10  
  * Unless required by applicable law or agreed to in writing,
 11  
  * software distributed under the License is distributed on an "AS IS"
 12  
  * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
 13  
  * or implied. See the License for the specific language governing
 14  
  * permissions and limitations under the License.
 15  
  */
 16  
 
 17  
 package org.kuali.student.r2.core.search.dto;
 18  
 
 19  
 import java.io.Serializable;
 20  
 import java.util.ArrayList;
 21  
 import java.util.List;
 22  
 
 23  
 import javax.xml.bind.annotation.XmlAccessType;
 24  
 import javax.xml.bind.annotation.XmlAccessorType;
 25  
 import javax.xml.bind.annotation.XmlAnyElement;
 26  
 import javax.xml.bind.annotation.XmlElement;
 27  
 import javax.xml.bind.annotation.XmlType;
 28  
 
 29  
 import org.kuali.student.r2.core.search.infc.SearchResultRow;
 30  
 import org.kuali.student.r2.core.search.infc.SearchResultCell;
 31  
 import org.w3c.dom.Element;
 32  
 
 33  
 @XmlAccessorType(XmlAccessType.FIELD)
 34  
 @XmlType(name = "SearchResultRowInfo", propOrder = {
 35  
                 "cells", "_futureElements" })
 36  
 
 37  
 public class SearchResultRowInfo 
 38  
     implements SearchResultRow, Serializable {
 39  
 
 40  
     private static final long serialVersionUID = 1L;
 41  
 
 42  
     @XmlElement
 43  
     private List<SearchResultCellInfo> cells;
 44  
 
 45  
     @XmlAnyElement
 46  
     private List<Element> _futureElements;
 47  
 
 48  
     
 49  
     /**
 50  
      * Constructs a new SearchResultRowInfo.
 51  
      */
 52  0
     public SearchResultRowInfo() {
 53  0
     }
 54  
 
 55  
     /**
 56  
      * Constructs a new SearchResultRowInfo from
 57  
      * another SearchResultRow.
 58  
      *
 59  
      * @param row the SearchResultRow to copy
 60  
      */
 61  0
     public SearchResultRowInfo(SearchResultRow row) {
 62  0
         if (row != null) {
 63  0
             this.cells = new ArrayList<SearchResultCellInfo>();
 64  0
             for (SearchResultCell cell : row.getCells()) {
 65  0
                 this.cells.add(new SearchResultCellInfo(cell));
 66  
             }
 67  
         }
 68  0
     }
 69  
     
 70  
     public void addCell(String key, String value) {
 71  0
         getCells().add(new SearchResultCellInfo(key, value));
 72  0
     }
 73  
     
 74  
     @Override
 75  
     public List<SearchResultCellInfo> getCells() {
 76  0
         if (cells == null) {
 77  0
             cells = new ArrayList<SearchResultCellInfo>(0);
 78  
         }
 79  0
         return cells;
 80  
     }
 81  
     
 82  
     public void setCells(List<SearchResultCellInfo> cells) {
 83  0
         this.cells = cells;
 84  0
     }
 85  
     
 86  
     @Override
 87  
     public String toString() {
 88  0
         return "SearchResultRow[cells=" + cells + "]";
 89  
     }
 90  
 }