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

io.getunleash.repository.FeatureCollection Maven / Gradle / Ivy

There is a newer version: 9.2.4
Show newest version
package io.getunleash.repository;

import io.getunleash.FeatureToggle;
import io.getunleash.Segment;
import java.util.Collections;

public final class FeatureCollection {

    private final ToggleCollection toggleCollection;
    private final SegmentCollection segmentCollection;

    public FeatureCollection() {
        this(
                new ToggleCollection(Collections.emptyList()),
                new SegmentCollection(Collections.emptyList()));
    }

    public FeatureCollection(
            ToggleCollection toggleCollection, SegmentCollection segmentCollection) {
        this.toggleCollection = toggleCollection;
        this.segmentCollection = segmentCollection;
    }

    public ToggleCollection getToggleCollection() {
        return toggleCollection;
    }

    public SegmentCollection getSegmentCollection() {
        return segmentCollection;
    }

    public FeatureToggle getToggle(String name) {
        return toggleCollection.getToggle(name);
    }

    public Segment getSegment(int id) {
        return segmentCollection.getSegment(id);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy