1   package org.imageconverter.domain.conversion;
2   
3   import static org.apache.commons.lang3.StringUtils.upperCase;
4   
5   import io.swagger.v3.oas.annotations.media.Schema;
6   
7   
8   
9   
10  
11  
12  @Schema(enumAsRef = true)
13  public enum ExecutionType {
14  
15      UNKNOWN,
16      
17      BATCH,
18  
19      WS,
20  
21      MS,
22      
23      WEB,
24      
25      DESKTOP;
26      
27      
28  
29  
30  
31  
32  
33      public static ExecutionType from(final String string) {
34  	   
35  	final var stringTypeNew = upperCase(string);
36  	
37  	return switch (stringTypeNew) { 
38  	        case "BATCH" -> BATCH; 
39  	        case "WS" -> WS; 
40  	        case "MS" -> MS; 
41  	        case "WEB" -> WEB; 
42  	        case "DESKTOP" -> DESKTOP; 
43  	        default -> UNKNOWN;
44  	};
45      }
46  }