test_class.declarator: converter = new StringToNumberConverter()
test_class.original_string: StringToNumberConverter converter = new StringToNumberConverter();
test_class.type: StringToNumberConverter
test_class.var_name: converter
test_class.file: beanmother-core/src/test/java/io/beanmother/core/converter/std/StringToNumberConverterTest.java
test_class.identifier: StringToNumberConverterTest
test_case.body: @Test
      public void testCanHandle() {
          assertTrue(converter.canHandle("1", TypeToken.of(Integer.class)));
          assertTrue(converter.canHandle("1", TypeToken.of(Float.class)));
          assertTrue(converter.canHandle("1", TypeToken.of(Short.class)));
          assertTrue(converter.canHandle("1", TypeToken.of(Double.class)));
          assertTrue(converter.canHandle("1", TypeToken.of(Long.class)));
  
          assertTrue(converter.canHandle("1", TypeToken.of(Integer.class)));
          assertTrue(converter.canHandle("1", TypeToken.of(int.class)));
          assertTrue(converter.canHandle("1", TypeToken.of(short.class)));
          assertTrue(converter.canHandle("1", TypeToken.of(double.class)));
          assertTrue(converter.canHandle("1", TypeToken.of(long.class)));
  
          assertFalse(converter.canHandle("abc", TypeToken.of(Integer.class)));
          assertFalse(converter.canHandle("1", TypeToken.of(String.class)));
      }
test_case.class_method_signature: StringToNumberConverterTest.testCanHandle()
test_case.full_signature: @Test public void testCanHandle()
test_case.identifier: testCanHandle
test_case.invocations: assertTrue canHandle of assertTrue canHandle of assertTrue canHandle of assertTrue canHandle of assertTrue canHandle of assertTrue canHandle of assertTrue canHandle of assertTrue canHandle of assertTrue canHandle of assertTrue canHandle of assertFalse canHandle of assertFalse canHandle of
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testCanHandle()
focal_class.file: beanmother-core/src/main/java/io/beanmother/core/converter/std/StringToNumberConverter.java
focal_class.identifier: StringToNumberConverter
focal_class.class_method_signature: StringToNumberConverter.convert(Object source, TypeToken<?> targetTypeToken)
focal_class.full_signature: @Override public Object convert(Object source, TypeToken<?> targetTypeToken)
focal_class.identifier: convert
focal_class.modifiers: @Override public
focal_class.parameters: (Object source, TypeToken<?> targetTypeToken)
focal_class.return: Object
focal_class.signature: Object convert(Object source, TypeToken<?> targetTypeToken)
focal_class.class_method_signature: StringToNumberConverter.canHandle(Object source, TypeToken<?> targetTypeToken)
focal_class.full_signature: @Override public boolean canHandle(Object source, TypeToken<?> targetTypeToken)
focal_class.identifier: canHandle
focal_class.modifiers: @Override public
focal_class.parameters: (Object source, TypeToken<?> targetTypeToken)
focal_class.return: boolean
focal_class.signature: boolean canHandle(Object source, TypeToken<?> targetTypeToken)
focal_class.superclass: extends AbstractConverter
focal_method.body: @Override
      public boolean canHandle(Object source, TypeToken<?> targetTypeToken) {
          if (targetTypeToken.isPrimitive()) {
              targetTypeToken = PrimitiveTypeUtils.toWrapperTypeToken(targetTypeToken);
          }
          if (!targetTypeToken.isSubtypeOf(Number.class)) return false;
  
          if (!(source instanceof String)) return false;
  
          try {
              NumberUtils.parseNumber((String) source, (Class) targetTypeToken.getType());
              return true;
          } catch (IllegalArgumentException e){
              return false;
          }
      }
focal_method.class_method_signature: StringToNumberConverter.canHandle(Object source, TypeToken<?> targetTypeToken)
focal_method.full_signature: @Override public boolean canHandle(Object source, TypeToken<?> targetTypeToken)
focal_method.identifier: canHandle
focal_method.invocations: isPrimitive toWrapperTypeToken isSubtypeOf parseNumber getType
focal_method.modifiers: @Override public
focal_method.parameters: (Object source, TypeToken<?> targetTypeToken)
focal_method.return: boolean
focal_method.signature: boolean canHandle(Object source, TypeToken<?> targetTypeToken)