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

io.rtr.alchemy.dto.models.ExperimentDto Maven / Gradle / Ivy

There is a newer version: 2.2.14
Show newest version
package io.rtr.alchemy.dto.models;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.common.base.Objects;

import org.joda.time.DateTime;

import java.util.List;
import java.util.Set;

/** Represents an experiment */
public class ExperimentDto {
    private final String name;
    private final int seed;
    private final String description;
    private final String filter;
    private final Set hashAttributes;
    private final boolean active;
    private final DateTime created;
    private final DateTime modified;
    private final DateTime activated;
    private final DateTime deactivated;
    private final List treatments;
    private final List allocations;
    private final List overrides;

    @JsonCreator
    public ExperimentDto(
            @JsonProperty("name") String name,
            @JsonProperty("seed") int seed,
            @JsonProperty("description") String description,
            @JsonProperty("filter") String filter,
            @JsonProperty("hashAttributes") Set hashAttributes,
            @JsonProperty("active") boolean active,
            @JsonProperty("created") DateTime created,
            @JsonProperty("modified") DateTime modified,
            @JsonProperty("activated") DateTime activated,
            @JsonProperty("deactivated") DateTime deactivated,
            @JsonProperty("treatments") List treatments,
            @JsonProperty("allocations") List allocations,
            @JsonProperty("overrides") List overrides) {
        this.name = name;
        this.seed = seed;
        this.description = description;
        this.filter = filter;
        this.hashAttributes = hashAttributes;
        this.active = active;
        this.created = created;
        this.modified = modified;
        this.activated = activated;
        this.deactivated = deactivated;
        this.treatments = treatments;
        this.allocations = allocations;
        this.overrides = overrides;
    }

    public String getName() {
        return name;
    }

    public int getSeed() {
        return seed;
    }

    public String getDescription() {
        return description;
    }

    public String getFilter() {
        return filter;
    }

    public Set getHashAttributes() {
        return hashAttributes;
    }

    public boolean isActive() {
        return active;
    }

    public DateTime getCreated() {
        return created;
    }

    public DateTime getModified() {
        return modified;
    }

    public DateTime getActivated() {
        return activated;
    }

    public DateTime getDeactivated() {
        return deactivated;
    }

    public List getTreatments() {
        return treatments;
    }

    public List getAllocations() {
        return allocations;
    }

    public List getOverrides() {
        return overrides;
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(name);
    }

    @Override
    public boolean equals(Object obj) {
        if (!(obj instanceof ExperimentDto)) {
            return false;
        }

        final ExperimentDto other = (ExperimentDto) obj;

        return Objects.equal(name, other.name);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy