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

org.kie.server.api.model.KieContainerResource Maven / Gradle / Ivy

package org.kie.server.api.model;

import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "kie-container")
public class KieContainerResource {

    private String             containerId;
    private ReleaseId          releaseId;
    private ReleaseId          resolvedReleaseId;
    private KieContainerStatus status;
    private KieScannerResource scanner;

    public KieContainerResource() {
    }

    public KieContainerResource(ReleaseId releaseId) {
        this( null, releaseId, null, null );
    }
    
    public KieContainerResource(String containerId, ReleaseId releaseId) {
        this( containerId, releaseId, null, null );
    }
    
    public KieContainerResource(String containerId, ReleaseId releaseId, KieContainerStatus status) {
        this( containerId, releaseId, null, status );
    }
    
    public KieContainerResource(String containerId, ReleaseId releaseId, ReleaseId resolvedReleaseId, KieContainerStatus status) {
        this.containerId = containerId;
        this.releaseId = releaseId;
        this.resolvedReleaseId = resolvedReleaseId;
        this.status = status;
    }

    @XmlAttribute(name = "container-id")
    public String getContainerId() {
        return containerId;
    }

    public void setContainerId(String containerId) {
        this.containerId = containerId;
    }

    @XmlAttribute(name = "status")
    public KieContainerStatus getStatus() {
        return status;
    }

    public void setStatus(KieContainerStatus status) {
        this.status = status;
    }

    @XmlElement(name = "release-id")
    public ReleaseId getReleaseId() {
        return releaseId;
    }

    public void setReleaseId(ReleaseId releaseId) {
        this.releaseId = releaseId;
    }

    @XmlElement(name = "resolved-release-id")
    public ReleaseId getResolvedReleaseId() {
        return resolvedReleaseId;
    }

    public void setResolvedReleaseId(ReleaseId resolvedReleaseId) {
        this.resolvedReleaseId = resolvedReleaseId;
    }
    
    @XmlElement
    public KieScannerResource getScanner() {
        return scanner;
    }
    
    public void setScanner(KieScannerResource scanner) {
        this.scanner = scanner;
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((containerId == null) ? 0 : containerId.hashCode());
        result = prime * result + ((releaseId == null) ? 0 : releaseId.hashCode());
        result = prime * result + ((resolvedReleaseId == null) ? 0 : resolvedReleaseId.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;
        KieContainerResource other = (KieContainerResource) obj;
        if (containerId == null) {
            if (other.containerId != null)
                return false;
        } else if (!containerId.equals(other.containerId))
            return false;
        if (releaseId == null) {
            if (other.releaseId != null)
                return false;
        } else if (!releaseId.equals(other.releaseId))
            return false;
        if (resolvedReleaseId == null) {
            if (other.resolvedReleaseId != null)
                return false;
        } else if (!resolvedReleaseId.equals(other.resolvedReleaseId))
            return false;
        if (status != other.status)
            return false;
        return true;
    }

    @Override
    public String toString() {
        return "KieContainerResource [containerId=" + containerId + ", releaseId=" + releaseId + ", resolvedReleaseId=" + resolvedReleaseId + ", status=" + status + "]";
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy