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

org.defendev.common.domain.iam.Privilege Maven / Gradle / Ivy

Go to download

Common utils purely based on JDK and no other dependencies. Only exception being for org.jetbrains:annotations for building stratgic Kotlin language compatibility.Another only-exception is Apache Commons Lang3.

The newest version!
package org.defendev.common.domain.iam;

import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;



public enum Privilege {

    own(Set.of()),

    write(Set.of(own)),

    read(Set.of(write, own)),

    preview(Set.of(read, write, own));

    private final Set containedIn;

    Privilege(Set containedIn) {
        this.containedIn = Stream.concat(Stream.of(this), containedIn.stream()).collect(Collectors.toSet());
    }

    public Set getContainedIn() {
        return containedIn;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy