@Test public void testUnboxDefaultTypes() { assertEquals(Short.class.getName(), unboxDefaultType("short")); assertEquals(Short.class.getName(), unboxDefaultType("Short")); assertEquals(Integer.class.getName(), unboxDefaultType("int")); assertEquals(Integer.class.getName(), unboxDefaultType("Integer")); assertEquals(Long.class.getName(), unboxDefaultType("long")); assertEquals(Long.class.getName(), unboxDefaultType("Long")); assertEquals(Float.class.getName(), unboxDefaultType("float")); assertEquals(Float.class.getName(), unboxDefaultType("Float")); assertEquals(Double.class.getName(), unboxDefaultType("double")); assertEquals(Double.class.getName(), unboxDefaultType("Double")); assertEquals(Character.class.getName(), unboxDefaultType("char")); assertEquals(Character.class.getName(), unboxDefaultType("Character")); assertEquals(String.class.getName(), unboxDefaultType("String")); assertEquals(Object.class.getName(), unboxDefaultType("Object")); assertEquals("Other_value", unboxDefaultType("Other_value")); assertEquals(null, unboxDefaultType(null)); }
static String unboxDefaultType(String type) { if (type == null) { return null; } switch (type) { case "Short": case "short": return Short.class.getName(); case "Integer": case "int": return Integer.class.getName(); case "Long": case "long": return Long.class.getName(); case "Float": case "float": return Float.class.getName(); case "Double": case "double": return Double.class.getName(); case "Boolean": case "boolean": return Boolean.class.getName(); case "Character": case "char": return Character.class.getName(); case "String": return String.class.getName(); case "Object": return Object.class.getName(); default: return type; } }
VariableSearchService implements LiveSearchService<String> { static String unboxDefaultType(String type) { if (type == null) { return null; } switch (type) { case "Short": case "short": return Short.class.getName(); case "Integer": case "int": return Integer.class.getName(); case "Long": case "long": return Long.class.getName(); case "Float": case "float": return Float.class.getName(); case "Double": case "double": return Double.class.getName(); case "Boolean": case "boolean": return Boolean.class.getName(); case "Character": case "char": return Character.class.getName(); case "String": return String.class.getName(); case "Object": return Object.class.getName(); default: return type; } } }
VariableSearchService implements LiveSearchService<String> { static String unboxDefaultType(String type) { if (type == null) { return null; } switch (type) { case "Short": case "short": return Short.class.getName(); case "Integer": case "int": return Integer.class.getName(); case "Long": case "long": return Long.class.getName(); case "Float": case "float": return Float.class.getName(); case "Double": case "double": return Double.class.getName(); case "Boolean": case "boolean": return Boolean.class.getName(); case "Character": case "char": return Character.class.getName(); case "String": return String.class.getName(); case "Object": return Object.class.getName(); default: return type; } } @Inject  VariableSearchService(final ConditionEditorMetadataService metadataService,
                                 final ClientTranslationService translationService); }
VariableSearchService implements LiveSearchService<String> { static String unboxDefaultType(String type) { if (type == null) { return null; } switch (type) { case "Short": case "short": return Short.class.getName(); case "Integer": case "int": return Integer.class.getName(); case "Long": case "long": return Long.class.getName(); case "Float": case "float": return Float.class.getName(); case "Double": case "double": return Double.class.getName(); case "Boolean": case "boolean": return Boolean.class.getName(); case "Character": case "char": return Character.class.getName(); case "String": return String.class.getName(); case "Object": return Object.class.getName(); default: return type; } } @Inject  VariableSearchService(final ConditionEditorMetadataService metadataService,
                                 final ClientTranslationService translationService); void init(ClientSession session); @Override void search(String pattern, int maxResults, LiveSearchCallback<String> callback); @Override void searchEntry(String key, LiveSearchCallback<String> callback); String getOptionType(String key); void clear(); }
VariableSearchService implements LiveSearchService<String> { static String unboxDefaultType(String type) { if (type == null) { return null; } switch (type) { case "Short": case "short": return Short.class.getName(); case "Integer": case "int": return Integer.class.getName(); case "Long": case "long": return Long.class.getName(); case "Float": case "float": return Float.class.getName(); case "Double": case "double": return Double.class.getName(); case "Boolean": case "boolean": return Boolean.class.getName(); case "Character": case "char": return Character.class.getName(); case "String": return String.class.getName(); case "Object": return Object.class.getName(); default: return type; } } @Inject  VariableSearchService(final ConditionEditorMetadataService metadataService,
                                 final ClientTranslationService translationService); void init(ClientSession session); @Override void search(String pattern, int maxResults, LiveSearchCallback<String> callback); @Override void searchEntry(String key, LiveSearchCallback<String> callback); String getOptionType(String key); void clear();  }