Make ListFlag lists immutable

This commit is contained in:
Alexander Söderberg 2020-02-16 14:49:47 +01:00
parent 3a694c458c
commit e9c69dc80c

View File

@ -7,12 +7,13 @@ import com.github.intellectualsites.plotsquared.plot.util.StringMan;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List; import java.util.List;
public abstract class ListFlag<V, F extends PlotFlag<List<V>, F>> extends PlotFlag<List<V>, F> { public abstract class ListFlag<V, F extends PlotFlag<List<V>, F>> extends PlotFlag<List<V>, F> {
public ListFlag(final List<V> valueList, final Captions category, final Caption description) { public ListFlag(final List<V> valueList, final Captions category, final Caption description) {
super(valueList, category, description); super(Collections.unmodifiableList(valueList), category, description);
} }
@Override public F merge(@NotNull List<V> newValue) { @Override public F merge(@NotNull List<V> newValue) {