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

com.disdar.api.model.DocumentAnalysisRequest Maven / Gradle / Ivy

There is a newer version: 0.4.0
Show newest version
package com.disdar.api.model;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import java.net.MalformedURLException;
import java.net.URL;

/**
 * A class encapsulating all incoming arguments needed for the extraction process.
 */
@JsonIgnoreProperties(ignoreUnknown = true)
public class DocumentAnalysisRequest {

    @NotBlank
    private String requestId;
    @NotNull
    private URL fileURL;

    private URL callbackURL;

    @JsonCreator
    public DocumentAnalysisRequest(@JsonProperty("requestId") String requestId,
                                   @JsonProperty("fileURL") URL fileURL,
                                   @JsonProperty("callbackURL") URL callbackURL) throws MalformedURLException {
        this.requestId = requestId;
        this.fileURL = fileURL;
        this.callbackURL = callbackURL;
    }

    public String getRequestId() {
        return requestId;
    }

    public URL getFileURL() {
        return fileURL;
    }

    public URL getCallbackURL() {
        return callbackURL;
    }

    @Override
    public boolean equals(Object obj) {
        return EqualsBuilder.reflectionEquals(this, obj);
    }

    @Override
    public int hashCode() {
        return HashCodeBuilder.reflectionHashCode(this);
    }

    @Override
    public String toString() {
        return "DocumentAnalysisRequest: "+requestId;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy