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

com.indeed.proctor.common.model.Allocation Maven / Gradle / Ivy

package com.indeed.proctor.common.model;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class Allocation {
    @Nullable
    private String rule;

    /**
     * Map from a bucket name
     */
    @Nonnull
    private List ranges = Collections.emptyList();

    public Allocation() { /* intentionally empty */ }

    public Allocation(@Nullable final String rule, @Nonnull final List ranges) {
        this.rule = rule;
        this.ranges = ranges;
    }

    public Allocation(@Nonnull final Allocation other) {
        this.rule = other.rule;
        this.ranges = new ArrayList();
        for (final Range range : other.getRanges()) {
            this.ranges.add(new Range(range));
        }
    }


    @Nullable
    public String getRule() {
        return rule;
    }

    @SuppressWarnings("UnusedDeclaration")
    public void setRule(@Nullable final String rule) {
        this.rule = rule;
    }

    @Nonnull
    public List getRanges() {
        return ranges;
    }

    public void setRanges(@Nonnull final List ranges) {
        this.ranges = ranges;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy