/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package pl.edu.pwr.nlptools;

import java.util.logging.Level;
import java.util.logging.Logger;
import org.json.JSONObject;

/**
 *
 * @author www_zsk
 */
public class Status
    {  private String status;
       private String value; 
       Status(String json)
       { JSONObject resultJSON=new JSONObject(json);
         value=resultJSON.getString("value");    
         status=resultJSON.getString("status");    
       }
       
       
           
       public Boolean isError()
       {
           return status.equalsIgnoreCase("ERROR");
       }
       
       public Boolean isReady()
       {
           return status.equalsIgnoreCase("DONE");
       }
       
       public boolean isWaiting() {
            return status.equalsIgnoreCase("QUEUE") || status.equalsIgnoreCase("PROCESSING");
        }
       
        /**
         * @return the status
         */
        public String getStatus() {
            return status;
        }

        /**
         * @param status the status to set
         */
        public void setStatus(String status) {
            this.status = status;
        }

        /**
         * @return the value
         */
        public String getValue() {
            return value;
        }

        /**
         * @param value the value to set
         */
        public void setValue(String value) {
            this.value = value;
        }

        
       
    }
