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

com.harrys.hyppo.source.api.model.DataIngestionJob Maven / Gradle / Ivy

There is a newer version: 0.6.4
Show newest version
package com.harrys.hyppo.source.api.model;

import com.typesafe.config.Config;
import org.codehaus.jackson.annotate.JsonCreator;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonDeserialize;
import org.codehaus.jackson.map.annotate.JsonSerialize;

import java.io.Serializable;
import java.util.Date;
import java.util.UUID;

/**
 * Created by jpetty on 7/6/15.
 */
public final class DataIngestionJob implements Serializable {
    private static final long serialVersionUID = 1L;

    private final IngestionSource ingestionSource;

    private final UUID id;

    @JsonSerialize(using = ConfigToJson.Serializer.class)
    @JsonDeserialize(using = ConfigToJson.Deserializer.class)
    private final Config parameters;

    @JsonProperty("startedAt")
    private final Date startedAt;

    @JsonCreator
    public DataIngestionJob(
            @JsonProperty("ingestionSource")    final IngestionSource ingestionSource,
            @JsonProperty("id")                 final UUID id,
            @JsonProperty("parameters")         final Config parameters,
            @JsonProperty("startedAt")          final Date startedAt
    ) {
        this.ingestionSource = ingestionSource;
        this.id = id;
        this.parameters = parameters;
        this.startedAt  = startedAt;
    }

    public final IngestionSource getIngestionSource() {
        return ingestionSource;
    }

    public final UUID getId() {
        return id;
    }

    public final Config getParameters() {
        return parameters;
    }

    public final Date getStartedAt(){
        return this.startedAt;
    }

    @Override
    public final  boolean equals(Object check){
        if (check instanceof DataIngestionJob){
            final DataIngestionJob other = (DataIngestionJob)check;
            return (
                    ingestionSource.equals(other.getIngestionSource()) &&
                    id.equals(other.getId()) &&
                    parameters.equals(other.getParameters()) &&
                    startedAt.equals(other.getStartedAt())
            );
        } else {
            return super.equals(check);
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy