test_class.declarator: converter = new JodaTimeSingleFieldPeriodConverter()
test_class.original_string: JodaTimeSingleFieldPeriodConverter converter = new JodaTimeSingleFieldPeriodConverter();
test_class.type: JodaTimeSingleFieldPeriodConverter
test_class.var_name: converter
test_class.file: beanmother-joda-time-converter/src/test/java/io/beanmother/joda/converter/JodaTimeSingleFieldPeriodConverterTest.java
test_class.identifier: JodaTimeSingleFieldPeriodConverterTest
test_case.body: @Test(expected = ConverterException.class)
      public void testConvertExceptionBySource() {
          converter.convert(new Date(), TypeToken.of(Hours.class));
      }
test_case.class_method_signature: JodaTimeSingleFieldPeriodConverterTest.testConvertExceptionBySource()
test_case.full_signature: @Test(expected = ConverterException.class) public void testConvertExceptionBySource()
test_case.identifier: testConvertExceptionBySource
test_case.invocations: convert of
test_case.modifiers: @Test(expected = ConverterException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testConvertExceptionBySource()
focal_class.declarator: stringToNumberConverter = new StringToNumberConverter()
focal_class.modifier: private final static
focal_class.original_string: private final static StringToNumberConverter stringToNumberConverter = new StringToNumberConverter();
focal_class.type: StringToNumberConverter
focal_class.var_name: stringToNumberConverter
focal_class.declarator: numberToNumberConverter = new NumberToNumberConverter()
focal_class.modifier: private final static
focal_class.original_string: private final static NumberToNumberConverter numberToNumberConverter = new NumberToNumberConverter();
focal_class.type: NumberToNumberConverter
focal_class.var_name: numberToNumberConverter
focal_class.file: beanmother-joda-time-converter/src/main/java/io/beanmother/joda/converter/JodaTimeSingleFieldPeriodConverter.java
focal_class.identifier: JodaTimeSingleFieldPeriodConverter
focal_class.class_method_signature: JodaTimeSingleFieldPeriodConverter.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: JodaTimeSingleFieldPeriodConverter.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 Object convert(Object source, TypeToken<?> targetTypeToken) {
          if (!canHandle(source, targetTypeToken)) {
              throw new ConverterException(source, targetTypeToken.getRawType());
          }
  
          Integer period = null;
          if (source instanceof Number) {
              period = (Integer) numberToNumberConverter.convert(source, TypeToken.of(Integer.class));
          } else if (source instanceof String) {
              period = (Integer) stringToNumberConverter.convert(source, TypeToken.of(Integer.class));
          }
  
          Type targetType = targetTypeToken.getType();
  
          if (targetType.equals(Seconds.class)) {
              return Seconds.seconds(period);
          } else if (targetType.equals(Minutes.class)) {
              return Minutes.minutes(period);
          } else if (targetType.equals(Hours.class)) {
              return Hours.hours(period);
          } else if (targetType.equals(Days.class)) {
              return Days.days(period);
          } else if (targetType.equals(Weeks.class)) {
              return Weeks.weeks(period);
          } else if (targetType.equals(Months.class)) {
              return Months.months(period);
          } else if (targetType.equals(Years.class)) {
              return Years.years(period);
          }
  
          throw new ConverterException(source, targetTypeToken.getRawType());
      }
focal_method.class_method_signature: JodaTimeSingleFieldPeriodConverter.convert(Object source, TypeToken<?> targetTypeToken)
focal_method.full_signature: @Override public Object convert(Object source, TypeToken<?> targetTypeToken)
focal_method.identifier: convert
focal_method.invocations: canHandle getRawType convert of convert of getType equals seconds equals minutes equals hours equals days equals weeks equals months equals years getRawType
focal_method.modifiers: @Override public
focal_method.parameters: (Object source, TypeToken<?> targetTypeToken)
focal_method.return: Object
focal_method.signature: Object convert(Object source, TypeToken<?> targetTypeToken)