Example usage for java.util EnumSet noneOf

List of usage examples for java.util EnumSet noneOf

Introduction

In this page you can find the example usage for java.util EnumSet noneOf.

Prototype

public static <E extends Enum<E>> EnumSet<E> noneOf(Class<E> elementType) 

Source Link

Document

Creates an empty enum set with the specified element type.

Usage

From source file:org.opencb.opencga.catalog.auth.authorization.CatalogAuthorizationManager.java

private DatasetAclEntry transformStudyAclToDatasetAcl(StudyAclEntry studyAcl) {
    DatasetAclEntry datasetAcl = new DatasetAclEntry(null, Collections.emptyList());
    if (studyAcl == null) {
        return datasetAcl;
    }/*from  ww w. j  a v a  2 s. c  o m*/

    datasetAcl.setMember(studyAcl.getMember());
    EnumSet<StudyAclEntry.StudyPermissions> studyPermissions = studyAcl.getPermissions();
    EnumSet<DatasetAclEntry.DatasetPermissions> datasetPermissions = EnumSet
            .noneOf(DatasetAclEntry.DatasetPermissions.class);

    for (StudyAclEntry.StudyPermissions studyPermission : studyPermissions) {
        DatasetAclEntry.DatasetPermissions aux = studyPermission.getDatasetPermission();
        if (aux != null) {
            datasetPermissions.add(aux);
        }
    }
    datasetAcl.setPermissions(datasetPermissions);
    return datasetAcl;
}

From source file:org.opencb.opencga.catalog.auth.authorization.CatalogAuthorizationManager.java

private DiseasePanelAclEntry transformStudyAclToDiseasePanelAcl(StudyAclEntry studyAcl) {
    DiseasePanelAclEntry panelAcl = new DiseasePanelAclEntry(null, Collections.emptyList());
    if (studyAcl == null) {
        return panelAcl;
    }//w w w .  ja va 2s.com

    panelAcl.setMember(studyAcl.getMember());
    EnumSet<StudyAclEntry.StudyPermissions> studyPermissions = studyAcl.getPermissions();
    EnumSet<DiseasePanelAclEntry.DiseasePanelPermissions> datasetPermissions = EnumSet
            .noneOf(DiseasePanelAclEntry.DiseasePanelPermissions.class);

    for (StudyAclEntry.StudyPermissions studyPermission : studyPermissions) {
        DiseasePanelAclEntry.DiseasePanelPermissions aux = studyPermission.getDiseasePanelPermission();
        if (aux != null) {
            datasetPermissions.add(aux);
        }
    }
    panelAcl.setPermissions(datasetPermissions);
    return panelAcl;
}

From source file:com.quinsoft.zeidon.vml.VmlOperation.java

protected int SetMatchingAttributesByName(View tgtView, String tgtEntity, View srcView, String srcEntity,
        int control) {
    int nRC;/* w  w w. j ava  2 s.c om*/
    EntityCursor tgtCursor = tgtView.cursor(tgtEntity);
    EntityCursor srcCursor = srcView.cursor(srcEntity);
    if (tgtCursor.isNull() || srcCursor.isNull()) {
        return zCALL_ERROR;
    }

    EnumSet<SetMatchingFlags> flags = EnumSet.noneOf(SetMatchingFlags.class);
    if ((control & zSET_KEYS) != 0) {
        flags.add(SetMatchingFlags.fSET_KEYS);
    }

    if ((control & zSET_NOTNULL) != 0) {
        flags.add(SetMatchingFlags.fSET_NOTNULL);
    }

    if ((control & zSET_SRCNOTNULL) != 0) {
        flags.add(SetMatchingFlags.fSET_SRCNOTNULL);
    }

    nRC = tgtCursor.setMatchingAttributesByName(srcView.getCursor(srcEntity), flags);

    return nRC;
}