Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package org.kie.remote.services.jaxb;
  
  import java.util.Iterator;
  import java.util.List;
  
 
 import  org.codehaus.jackson.annotate.JsonTypeInfo;
 import  org.codehaus.jackson.annotate.JsonTypeInfo.Id;
 import  org.kie.api.command.Command;
 import  org.kie.api.task.model.TaskSummary;
 import  org.kie.services.client.serialization.jaxb.impl.AbstractJaxbCommandResponse;
 import  org.kie.services.client.serialization.jaxb.impl.JaxbPaginatedList;
 import  org.kie.services.client.serialization.jaxb.impl.task.JaxbTaskSummary;
 
 @XmlRootElement(name="task-summary-list-response")
 public class JaxbTaskSummaryListResponse extends AbstractJaxbCommandResponse<List<TaskSummary>> implements JaxbPaginatedList<TaskSummary> {
 
     @XmlElements({
         @XmlElement(name="task-summary",type=JaxbTaskSummary.class)
     })
     @JsonTypeInfo(defaultImpl=JaxbTaskSummary.class, use=Id.CLASS)
     private List<TaskSummary> taskSummaryList;
 
     @XmlElement(name="page-number")
     @XmlSchemaType(name="int")
     private Integer pageNumber;
     
     @XmlElement(name="page-size")
     @XmlSchemaType(name="int")
     private Integer pageSize;
     
     public JaxbTaskSummaryListResponse() { 
         this. = new ArrayList<TaskSummary>();
     }
     
     public JaxbTaskSummaryListResponse(Collection<TaskSummary> taskSummaryCollection) { 
        this. = convertToJaxbTaskSummaryList(taskSummaryCollection);
     }
     
     public JaxbTaskSummaryListResponse(List<TaskSummary> taskSummaryCollectionint i, Command<?> cmd ) { 
         super(icmd);
        this. = convertToJaxbTaskSummaryList(taskSummaryCollection);
     }
     
     private List<TaskSummary> convertToJaxbTaskSummaryList(Collection<TaskSummary> list) {
         iflist == null || list.isEmpty() ) { 
             return new ArrayList<TaskSummary>();
         }
         List<TaskSummary> newList = new ArrayList<TaskSummary>(list.size());
         Iterator<TaskSummary> iter = list.iterator();
         while(iter.hasNext()) { 
             TaskSummary taskSum = iter.next();
             iftaskSum instanceof JaxbTaskSummary ) { 
                 newList.add(taskSum);
             } else { 
                 newList.add(new JaxbTaskSummary(taskSum));
             }
         }
         return newList;
     }
     
     
     @Override
     public List<TaskSummary> getResult() {
         return ;
     }
 
     @Override
     public void setResult(List<TaskSummary> result) {
         this. = convertToJaxbTaskSummaryList(result);
     }
 
     @Override
     public void addContents(List<TaskSummary> contentList) {
         this. = convertToJaxbTaskSummaryList(contentList);
     }
 
     @JsonTypeInfo(defaultImpl=JaxbTaskSummary.class, use=Id.CLASS)
     public List<TaskSummary> getList() {
         return ;
     }
 
     @JsonTypeInfo(defaultImpl=JaxbTaskSummary.class, use=Id.CLASS)
     public void setList(List<TaskSummary> result) {
         this. = result;
     }
 
     @Override
     public Integer getPageNumber() {
         return this.;
    }
    @Override
    public void setPageNumber(Integer page) {
        this. = page;
    }
    @Override
    public Integer getPageSize() {
        return this.;
    }
    @Override
    public void setPageSize(Integer pageSize) {
        this. = pageSize;
    }
New to GrepCode? Check out our FAQ X