Example usage for com.google.common.collect Sets immutableEnumSet

List of usage examples for com.google.common.collect Sets immutableEnumSet

Introduction

In this page you can find the example usage for com.google.common.collect Sets immutableEnumSet.

Prototype


@GwtCompatible(serializable = true)
public static <E extends Enum<E>> ImmutableSet<E> immutableEnumSet(E anElement, E... otherElements) 

Source Link

Document

Returns an immutable set instance containing the given enum elements.

Usage

From source file:org.caleydo.view.domino.internal.Node.java

public Set<EDimension> dimensions() {
    boolean dim = has(EDimension.DIMENSION);
    boolean rec = has(EDimension.RECORD);
    if (dim && rec)
        return Sets.immutableEnumSet(EDimension.DIMENSION, EDimension.RECORD);
    if (dim && !rec)
        return Sets.immutableEnumSet(EDimension.DIMENSION);
    if (!dim && rec)
        return Sets.immutableEnumSet(EDimension.RECORD);
    return Collections.emptySet();
}