private void initEventTypes ( IoEventType ... eventTypes ) { if ( ( eventTypes == null ) || ( eventTypes . length == 0 ) ) { eventTypes = DEFAULT_EVENT_SET ; } // Copy the list of handled events in the event set this . eventTypes = EnumSet . of ( eventTypes [ 0 ] , eventTypes ) ; // Check that we don't have the SESSION_CREATED event in the set if ( this . eventTypes . contains ( IoEventType . SESSION_CREATED ) ) { this . eventTypes = null ; throw new IllegalArgumentException ( IoEventType . SESSION_CREATED + " is not allowed." ) ; } }
Create an EnumSet from an array of EventTypes and set the associated eventTypes field .