Example usage for java.util EnumSet of

List of usage examples for java.util EnumSet of

Introduction

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

Prototype

public static <E extends Enum<E>> EnumSet<E> of(E e1, E e2, E e3, E e4, E e5) 

Source Link

Document

Creates an enum set initially containing the specified elements.

Usage

From source file:Numbers.java

public static void main(String[] args) {

    // create a set
    EnumSet<Numbers> set;//w w w.  ja  v  a2 s . c  om

    // add one element
    set = EnumSet.of(Numbers.FIVE, Numbers.FOUR, Numbers.THREE, Numbers.TWO, Numbers.ONE);

    System.out.println(set);

}

From source file:cx.jbzdak.diesIrae.genieConnector.ParamTest.java

@Before
public void startup() throws Exception {
    connector = new SimpleConnector();
    File f = new File("C:\\GENIE2K\\CAMFILES\\NBSSTD.CNF");
    File temp = File.createTempFile("gcTest", "CNF");
    temp.deleteOnExit();/*from  ww  w. j av a2s. c om*/
    FileUtils.copyFile(f, temp);
    connector.setFlush(FlushType.AUTO_COMMIT);
    connector.openFile(temp, EnumSet.of(OpenMode.READ_WRITE, OpenMode.SYSTEM_WRITE, OpenMode.EXCLUSIVE,
            OpenMode.TAKE_CONTROL, OpenMode.TAKE_OVER));
    //connector.openSource("DET_1", EnumSet.of(OpenMode.READ_WRITE, OpenMode.SYSTEM_WRITE, OpenMode.EXCLUSIVE), SourceType.DETECTOR);
}

From source file:alfio.manager.user.UserManager.java

public Collection<Role> getAvailableRoles(String username) {
    User user = findUserByUsername(username);
    return isAdmin(user) || isOwner(user)
            ? EnumSet.of(Role.OWNER, Role.OPERATOR, Role.SUPERVISOR, Role.SPONSOR, Role.API_CONSUMER)
            : Collections.emptySet();
}

From source file:org.obiba.mica.config.WebConfiguration.java

private void initAllowedMethods(ServletContext servletContext) {
    log.debug("Registering Allowed Methods Filter");

    FilterRegistration.Dynamic filterRegistration = servletContext.addFilter("noTrace", new NoTraceFilter());

    filterRegistration.addMappingForUrlPatterns(EnumSet.of(REQUEST, FORWARD, ASYNC, INCLUDE, ERROR), true,
            "/*");
    filterRegistration.setAsyncSupported(true);
}