package kz.cafe.client.rest.wrappers;

import javax.xml.bind.annotation.*;
import kz.cafe.client.*;
import kz.cafe.db.model.*;

public class JRAbstractDeleteableResponse extends JRAbstractResponse{

   private StringBuilder sbDeleted = new StringBuilder();
   
   @XmlElement(name="deleted")
   public String getDeleted(){
      if(sbDeleted.length() == 0){
         return null;
      }
      else{
         return sbDeleted.toString();
      }
   }
   
   


   public boolean checkDeleted(MAbstractEditableDataElement mAbstractEditableDataElement){
      if(mAbstractEditableDataElement.deleted || !mAbstractEditableDataElement.published){
         if(sbDeleted.length() > 0){
            sbDeleted.append(",");
         }
         sbDeleted.append(mAbstractEditableDataElement.ID);
         
         return false;
      }
      else{
         return true;
      }
   }




   public JRAbstractDeleteableResponse(){
      super();
   }




   public JRAbstractDeleteableResponse(Throwable e){
      super(e);
      // TODO Auto-generated constructor stub
   }
}
