@Test public void testCRSConverterFactory() { Set<ConverterFactory> set = Converters.getConverterFactories(STRING_CLASS, CRS_CLASS); assertNotNull(set); assertFalse(set.isEmpty()); assertEquals(set.size(), 1); assertSame(set.iterator().next().getClass(), CRSConverterFactory.class); Set<ConverterFactory> set1 = Converters.getConverterFactories(CRS_CLASS, STRING_CLASS); assertNotNull(set1); assertFalse(set1.isEmpty()); assertEquals(set1.size(), 1); assertSame(set1.iterator().next().getClass(), CRSConverterFactory.class); assertNull(new CRSConverterFactory().createConverter(null, null, null)); assertNull(new CRSConverterFactory().createConverter(String.class, null, null)); assertNull(new CRSConverterFactory().createConverter(String.class, Double.class, null)); }
public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (source == null || target == null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("CRSConverterFactory can be applied from Strings to CRS only."); } return null; } if (CoordinateReferenceSystem.class.isAssignableFrom(target) && String.class.isAssignableFrom(source)) { return STRING_TO_CRS; } if (CoordinateReferenceSystem.class.isAssignableFrom(source) && String.class.isAssignableFrom(target)) { return STRING_TO_CRS; } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("CRSConverterFactory can be applied from Strings to CRS only."); } return null; }
CRSConverterFactory implements ConverterFactory { public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (source == null || target == null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("CRSConverterFactory can be applied from Strings to CRS only."); } return null; } if (CoordinateReferenceSystem.class.isAssignableFrom(target) && String.class.isAssignableFrom(source)) { return STRING_TO_CRS; } if (CoordinateReferenceSystem.class.isAssignableFrom(source) && String.class.isAssignableFrom(target)) { return STRING_TO_CRS; } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("CRSConverterFactory can be applied from Strings to CRS only."); } return null; } }
CRSConverterFactory implements ConverterFactory { public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (source == null || target == null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("CRSConverterFactory can be applied from Strings to CRS only."); } return null; } if (CoordinateReferenceSystem.class.isAssignableFrom(target) && String.class.isAssignableFrom(source)) { return STRING_TO_CRS; } if (CoordinateReferenceSystem.class.isAssignableFrom(source) && String.class.isAssignableFrom(target)) { return STRING_TO_CRS; } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("CRSConverterFactory can be applied from Strings to CRS only."); } return null; }  }
CRSConverterFactory implements ConverterFactory { public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (source == null || target == null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("CRSConverterFactory can be applied from Strings to CRS only."); } return null; } if (CoordinateReferenceSystem.class.isAssignableFrom(target) && String.class.isAssignableFrom(source)) { return STRING_TO_CRS; } if (CoordinateReferenceSystem.class.isAssignableFrom(source) && String.class.isAssignableFrom(target)) { return STRING_TO_CRS; } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("CRSConverterFactory can be applied from Strings to CRS only."); } return null; }  Converter createConverter(Class<?> source, Class<?> target, Hints hints); }
CRSConverterFactory implements ConverterFactory { public Converter createConverter(Class<?> source, Class<?> target, Hints hints) { if (source == null || target == null) { if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("CRSConverterFactory can be applied from Strings to CRS only."); } return null; } if (CoordinateReferenceSystem.class.isAssignableFrom(target) && String.class.isAssignableFrom(source)) { return STRING_TO_CRS; } if (CoordinateReferenceSystem.class.isAssignableFrom(source) && String.class.isAssignableFrom(target)) { return STRING_TO_CRS; } if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine("CRSConverterFactory can be applied from Strings to CRS only."); } return null; }  Converter createConverter(Class<?> source, Class<?> target, Hints hints);  }