All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rapture.common.RaptureJobExec Maven / Gradle / Ivy

/**
 * The MIT License (MIT)
 *
 * Copyright (C) 2011-2016 Incapture Technologies LLC
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

/**
 * This file is autogenerated and any changes will be overwritten.
 */

package rapture.common;

import rapture.common.*;
import rapture.object.Searchable;
import rapture.object.Storable;
import rapture.object.Debugable;
import rapture.common.version.ApiVersion;
import rapture.common.impl.jackson.JacksonUtil;
import java.util.Map;
import java.util.HashMap;

import com.fasterxml.jackson.annotation.JsonProperty;

/**
* 
**/
@SuppressWarnings("all")
public class RaptureJobExec  implements RaptureTransferObject, Debugable ,Storable  {
    /*
    *  Start of field 'jobURI' (String) 
    */
    private String jobURI;

    @JsonProperty("jobURI")
    public String getJobURI() {
       return jobURI;
    }

    @JsonProperty("jobURI")
    public void setJobURI(String jobURI) {
       this.jobURI =  new RaptureURI(jobURI, Scheme.JOB).toString() /* TODO remove toString */  ;
    }
    /*
    *  end of field 'jobURI' (String) 
    */


    /*
    *  Start of field 'jobType' (JobType) 
    */
    private JobType jobType;

    @JsonProperty("jobType")
    public JobType getJobType() {
       return jobType;
    }

    @JsonProperty("jobType")
    public void setJobType(JobType jobType) {
       this.jobType =  jobType ;
    }
    /*
    *  end of field 'jobType' (JobType) 
    */


    /*
    *  Start of field 'status' (JobExecStatus) 
    */
    private JobExecStatus status = JobExecStatus.WAITING;

    @JsonProperty("status")
    public JobExecStatus getStatus() {
       return status;
    }

    @JsonProperty("status")
    public void setStatus(JobExecStatus status) {
       this.status =  status ;
    }
    /*
    *  end of field 'status' (JobExecStatus) 
    */


    /*
    *  Start of field 'execTime' (Long) 
    */
    private Long execTime;

    @JsonProperty("execTime")
    public Long getExecTime() {
       return execTime;
    }

    @JsonProperty("execTime")
    public void setExecTime(Long execTime) {
       this.execTime =  execTime ;
    }
    /*
    *  end of field 'execTime' (Long) 
    */


    /*
    *  Start of field 'passedParams' (Map) 
    */
    private Map passedParams = new HashMap();

    @JsonProperty("passedParams")
    public Map getPassedParams() {
       return passedParams;
    }

    @JsonProperty("passedParams")
    public void setPassedParams(Map passedParams) {
       this.passedParams =  passedParams ;
    }
    /*
    *  end of field 'passedParams' (Map) 
    */


    /*
    *  Start of field 'execDetails' (String) 
    */
    private String execDetails = "";

    @JsonProperty("execDetails")
    public String getExecDetails() {
       return execDetails;
    }

    @JsonProperty("execDetails")
    public void setExecDetails(String execDetails) {
       this.execDetails =  execDetails ;
    }
    /*
    *  end of field 'execDetails' (String) 
    */


   

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((jobURI == null) ? 0 : jobURI.hashCode());
        result = prime * result + ((passedParams == null) ? 0 : passedParams.hashCode());
        result = prime * result + ((execTime == null) ? 0 : execTime.hashCode());
        result = prime * result + ((jobType == null) ? 0 : jobType.hashCode());
        result = prime * result + ((execDetails == null) ? 0 : execDetails.hashCode());
        result = prime * result + ((status == null) ? 0 : status.hashCode());
        return result;
    }


    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;
        if (getClass() != obj.getClass()) return false;
        
        RaptureJobExec other = (RaptureJobExec) obj;

        if (jobURI == null) {
            if (other.jobURI != null) {
                return false;
            }
        } else if (!jobURI.equals(other.jobURI)) {
            return false;
        }

        if (passedParams == null) {
            if (other.passedParams != null) {
                return false;
            }
        } else if (!passedParams.equals(other.passedParams)) {
            return false;
        }

        if (execTime == null) {
            if (other.execTime != null) {
                return false;
            }
        } else if (!execTime.equals(other.execTime)) {
            return false;
        }

        if (jobType == null) {
            if (other.jobType != null) {
                return false;
            }
        } else if (!jobType.equals(other.jobType)) {
            return false;
        }

        if (execDetails == null) {
            if (other.execDetails != null) {
                return false;
            }
        } else if (!execDetails.equals(other.execDetails)) {
            return false;
        }

        if (status == null) {
            if (other.status != null) {
                return false;
            }
        } else if (!status.equals(other.status)) {
            return false;
        }

           
        return true;
    }


    /**/
    public String debug() {
        StringBuilder sb = new StringBuilder();
            {
                sb.append(" jobURI= ");
                Object o = jobURI;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" passedParams= ");
                Object o = passedParams;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" execTime= ");
                Object o = execTime;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" jobType= ");
                Object o = jobType;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" execDetails= ");
                Object o = execDetails;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

            {
                sb.append(" status= ");
                Object o = status;
                if (o != null) {
                    if (o instanceof java.util.Collection) {
                        sb.append("{ ");
                        for (Object oo : (java.util.Collection) o) {
                            if (oo == null) sb.append("null");
                            else if (oo instanceof Debugable) sb.append(((Debugable) oo).debug());
                            else sb.append(oo.toString()).append(", ");
                        }
                        sb.append(" } ");
                    } else {
                        if (o instanceof Debugable) sb.append(((Debugable) o).debug());
                        else sb.append(o.toString());
                    }
                }
            }

        return sb.append("\n").toString();
    }


    @Override
    public String getStoragePath() {
     // Add key fields
      return new RaptureJobExecPathBuilder()
        .jobURI(getJobURI())
        .execTime(getExecTime())
        .buildStoragePath();
    }
    
    @Override
    public RaptureURI getStorageLocation() {
       return new RaptureJobExecPathBuilder()
         .jobURI(getJobURI())
         .execTime(getExecTime())
         .buildStorageLocation();
    }
    
    


    @Override
    public String toString() {
        return JacksonUtil.jsonFromObject(this);
    }

    private ApiVersion _raptureVersion;

    @JsonProperty("_raptureVersion")
    public ApiVersion get_raptureVersion() {
        return _raptureVersion;
    }

    @JsonProperty("_raptureVersion")
    public void set_raptureVersion(ApiVersion _raptureVersion) {
        this._raptureVersion = _raptureVersion;
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy