/**
 * Copyright 2009-2017 the original author or authors.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package net.javacrumbs.shedlock.spring.annotation;

import org.springframework.context.annotation.ImportSelector;
import org.springframework.core.annotation.AnnotationAttributes;
import org.springframework.core.type.AnnotationMetadata;

import static net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock.InterceptMode;

class SchedulerLockConfigurationSelector implements ImportSelector {

    @Override
    public String[] selectImports(AnnotationMetadata metadata) {
        AnnotationAttributes attributes = AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(EnableSchedulerLock.class.getName(), false));
        Enum<?> mode = attributes.getEnum("mode");
        if (InterceptMode.PROXY_METHOD.equals(mode)) {
            return new String[]{MethodProxyLockConfiguration.class.getName()};
        }
        if (InterceptMode.PROXY_SCHEDULER.equals(mode)) {
            return new String[]{SchedulerProxyLockConfiguration.class.getName(), RegisterDefaultTaskSchedulerPostProcessor.class.getName()};
        }
        if (InterceptMode.PROXY_SCHEDULER_CGLIB.equals(mode)) {
            return new String[]{SchedulerProxyCglibLockConfiguration.class.getName(), RegisterDefaultTaskSchedulerPostProcessor.class.getName()};
        }
        throw new UnsupportedOperationException();
    }
}

@@ -1262,15 +1262,21 @@
     
-Enum%3C?%3E
+InterceptMode
  mod
@@ -1319,55 +1319,59 @@
     
-if (InterceptMode.PROXY_METHOD.equals(mode)) %7B%0A
+switch (mode) %7B%0A            case PROXY_METHOD:%0A    
     
@@ -1457,68 +1457,38 @@
     
-%7D%0A
     
-    if (InterceptMode.PROXY_SCHEDULER.equals(mode)) %7B%0A
+case PROXY_SCHEDULER:%0A    
     
@@ -1636,36 +1636,17 @@
     
-%7D%0A
     
-    if (InterceptMode.
+case 
 PROX
@@ -1666,25 +1666,14 @@
 GLIB
-.equals(mode)) %7B%0A
+:%0A    
     
@@ -1822,18 +1822,37 @@
         
-%7D%0A
+    default:%0A        
         
@@ -1891,18 +1891,50 @@
 ception(
-);
+%22Unknown mode %22 + mode);%0A        %7D
 %0A    %7D%0A%7D

Rewrite if to switch in LockConfigurationSelector