Java 类org.springframework.core.convert.converter.Converter 实例源码

项目:cas-5.1.0    文件:CasCoreBootstrapStandaloneConfiguration.java   
@ConfigurationPropertiesBinding
@Bean
public Converter<String, List<Class<? extends Throwable>>> commaSeparatedStringToThrowablesCollection() {
    return new Converter<String, List<Class<? extends Throwable>>>() {
        @Override
        public List<Class<? extends Throwable>> convert(final String source) {
            try {
                final List<Class<? extends Throwable>> classes = new ArrayList<>();
                for (final String className : StringUtils.commaDelimitedListToStringArray(source)) {
                    classes.add((Class<? extends Throwable>) ClassUtils.forName(className.trim(), getClass().getClassLoader()));
                }
                return classes;
            } catch (final Exception e) {
                throw new IllegalStateException(e);
            }
        }
    };
}
项目:wmboost-data    文件:ConversionServiceUtils.java   
private static void addDateConverters(GenericConversionService conversionService) {

        conversionService.addConverter(Date.class, String.class, new Converter<Date, String>() {
            @Override
            public String convert(Date dateVal) {
                return ValueConversionUtil.dateToIsoString(dateVal);
            }
        });
        conversionService.addConverter(String.class, Date.class, blankConverter(new Converter<String, Date>() {
            @Override
            public Date convert(String stringVal) {
                return ValueConversionUtil.isoStringToDate(stringVal);
            }
        }));

    }
项目:wmboost-data    文件:DocumentConversionService.java   
public DocumentConversionService(final DocumentFactory docFactory) {
    super();

    internalService.addConverter(IData.class, Document.class, new Converter<IData, Document>() {
        @Override
        public Document convert(IData idata) {
            return docFactory.wrap((IData) idata);
        }
    });
    internalService.addConverter(Document.class, IData.class, new Converter<Document, IData>() {
        @Override
        public IData convert(Document document) {
            return ((Document) document).getIData();
        }
    });
}
项目:spring4-understanding    文件:DefaultMessageHandlerMethodFactoryTests.java   
@Test
public void customConversion() throws Exception {
    DefaultMessageHandlerMethodFactory instance = createInstance();
    GenericConversionService conversionService = new GenericConversionService();
    conversionService.addConverter(SampleBean.class, String.class, new Converter<SampleBean, String>() {
        @Override
        public String convert(SampleBean source) {
            return "foo bar";
        }
    });
    instance.setConversionService(conversionService);
    instance.afterPropertiesSet();

    InvocableHandlerMethod invocableHandlerMethod =
            createInvocableHandlerMethod(instance, "simpleString", String.class);

    invocableHandlerMethod.invoke(MessageBuilder.withPayload(sample).build());
    assertMethodInvocation(sample, "simpleString");
}
项目:spring4-understanding    文件:ConversionServiceFactory.java   
/**
 * Register the given Converter objects with the given target ConverterRegistry.
 * @param converters the converter objects: implementing {@link Converter},
 * {@link ConverterFactory}, or {@link GenericConverter}
 * @param registry the target registry
 */
public static void registerConverters(Set<?> converters, ConverterRegistry registry) {
    if (converters != null) {
        for (Object converter : converters) {
            if (converter instanceof GenericConverter) {
                registry.addConverter((GenericConverter) converter);
            }
            else if (converter instanceof Converter<?, ?>) {
                registry.addConverter((Converter<?, ?>) converter);
            }
            else if (converter instanceof ConverterFactory<?, ?>) {
                registry.addConverterFactory((ConverterFactory<?, ?>) converter);
            }
            else {
                throw new IllegalArgumentException("Each converter object must implement one of the " +
                        "Converter, ConverterFactory, or GenericConverter interfaces");
            }
        }
    }
}
项目:spring4-understanding    文件:StreamConverterTests.java   
@Test
@SuppressWarnings("resource")
public void convertFromArrayToStream() throws NoSuchFieldException {
    Integer[] stream = new Integer[] {1, 0, 1};
    this.conversionService.addConverter(new Converter<Integer, Boolean>() {
        @Override
        public Boolean convert(Integer source) {
            return source == 1;
        }
    });
    TypeDescriptor streamOfBoolean = new TypeDescriptor(Types.class.getField("streamOfBooleans")); ;
    Object result = this.conversionService.convert(stream, streamOfBoolean);
    assertNotNull("converted object must not be null", result);
    assertTrue("Converted object must be a stream", result instanceof Stream);
    @SuppressWarnings("unchecked")
    Stream<Boolean> content = (Stream<Boolean>) result;
    assertEquals(2, content.filter(x -> x).count());
}
项目:spring4-understanding    文件:DefaultListableBeanFactoryTests.java   
@Test
public void testCustomConverter() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    GenericConversionService conversionService = new DefaultConversionService();
    conversionService.addConverter(new Converter<String, Float>() {
        @Override
        public Float convert(String source) {
            try {
                NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
                return nf.parse(source).floatValue();
            }
            catch (ParseException ex) {
                throw new IllegalArgumentException(ex);
            }
        }
    });
    lbf.setConversionService(conversionService);
    MutablePropertyValues pvs = new MutablePropertyValues();
    pvs.add("myFloat", "1,1");
    RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
    bd.setPropertyValues(pvs);
    lbf.registerBeanDefinition("testBean", bd);
    TestBean testBean = (TestBean) lbf.getBean("testBean");
    assertTrue(testBean.getMyFloat().floatValue() == 1.1f);
}
项目:redis-admin    文件:DefaultSetOperations.java   
@Override
public Cursor<V> scan(K key, final ScanOptions options) {

    final byte[] rawKey = rawKey(key);
    return execute(new RedisCallback<Cursor<V>>() {

        @Override
        public Cursor<V> doInRedis(RedisConnection connection) throws DataAccessException {
            return new ConvertingCursor<byte[], V>(connection.sScan(rawKey, options), new Converter<byte[], V>() {

                @Override
                public V convert(byte[] source) {
                    return deserializeValue(source);
                }
            });
        }
    }, true);

}
项目:redis-admin    文件:DefaultZSetOperations.java   
@Override
public Cursor<TypedTuple<V>> scan(K key, final ScanOptions options) {

    final byte[] rawKey = rawKey(key);
    Cursor<Tuple> cursor = execute(new RedisCallback<Cursor<Tuple>>() {

        @Override
        public Cursor<Tuple> doInRedis(RedisConnection connection) throws DataAccessException {
            connection.select(dbIndex);
            return connection.zScan(rawKey, options);
        }
    }, true);

    return new ConvertingCursor<Tuple, TypedTuple<V>>(cursor, new Converter<Tuple, TypedTuple<V>>() {

        @Override
        public TypedTuple<V> convert(Tuple source) {
            return deserializeTuple(source);
        }
    });
}
项目:spring    文件:ConversionServiceFactory.java   
/**
 * Register the given Converter objects with the given target ConverterRegistry.
 * @param converters the converter objects: implementing {@link Converter},
 * {@link ConverterFactory}, or {@link GenericConverter}
 * @param registry the target registry
 */
public static void registerConverters(Set<?> converters, ConverterRegistry registry) {
    if (converters != null) {
        for (Object converter : converters) {
            if (converter instanceof GenericConverter) {
                registry.addConverter((GenericConverter) converter);
            }
            else if (converter instanceof Converter<?, ?>) {
                registry.addConverter((Converter<?, ?>) converter);
            }
            else if (converter instanceof ConverterFactory<?, ?>) {
                registry.addConverterFactory((ConverterFactory<?, ?>) converter);
            }
            else {
                throw new IllegalArgumentException("Each converter object must implement one of the " +
                        "Converter, ConverterFactory, or GenericConverter interfaces");
            }
        }
    }
}
项目:opencucina    文件:ClientApplication.java   
private ConversionService conversionService(ApplicationContext applicationContext) {
    // TODO should be also able to resolve a url to a bean/method
    BeanFactoryResolver beanResolver = new BeanFactoryResolver(applicationContext) {
        @Override
        public Object resolve(EvaluationContext context, String beanName)
                throws AccessException {
            return super.resolve(context,
                    (beanName.startsWith("bean:") ? beanName.substring("bean:".length())
                            : beanName));
        }
    };

    ConversionServiceFactoryBean factoryBean = new ConversionServiceFactoryBean();
    Set<Converter<?, ?>> cons = new HashSet<Converter<?, ?>>();

    cons.add(new DtoCheckConverter(beanResolver));
    cons.add(new DtoOperationConverter(beanResolver));
    factoryBean.setConverters(cons);
    factoryBean.afterPropertiesSet();

    return factoryBean.getObject();
}
项目:dubbox-solr    文件:CustomConversions.java   
/**
 * Register custom converters within given {@link org.springframework.core.convert.support.GenericConversionService}
 *
 * @param conversionService must not be null
 */
public void registerConvertersIn(GenericConversionService conversionService) {
    Assert.notNull(conversionService);

    for (Object converter : converters) {
        if (converter instanceof Converter) {
            conversionService.addConverter((Converter<?, ?>) converter);
        } else if (converter instanceof ConverterFactory) {
            conversionService.addConverterFactory((ConverterFactory<?, ?>) converter);
        } else if (converter instanceof GenericConverter) {
            conversionService.addConverter((GenericConverter) converter);
        } else {
            throw new IllegalArgumentException("Given object '" + converter
                    + "' expected to be a Converter, ConverterFactory or GenericeConverter!");
        }
    }
}
项目:dubbox-solr    文件:CustomConversions.java   
private void registerConversion(Object converter) {
    Class<?> type = converter.getClass();
    boolean isWriting = type.isAnnotationPresent(WritingConverter.class);
    boolean isReading = type.isAnnotationPresent(ReadingConverter.class);

    if (!isReading && !isWriting) {
        isReading = true;
        isWriting = true;
    }

    if (converter instanceof GenericConverter) {
        GenericConverter genericConverter = (GenericConverter) converter;
        for (ConvertiblePair pair : genericConverter.getConvertibleTypes()) {
            register(new ConvertibleContext(pair, isReading, isWriting));
        }
    } else if (converter instanceof Converter) {
        Class<?>[] arguments = GenericTypeResolver.resolveTypeArguments(converter.getClass(), Converter.class);
        register(new ConvertibleContext(arguments[0], arguments[1], isReading, isWriting));
    } else {
        throw new IllegalArgumentException("Unsupported Converter type! Expected either GenericConverter if Converter.");
    }
}
项目:components-html5    文件:Jsr310Converters.java   
/**
 * Returns the converters to be registered. Will only return converters in case we're running on Java 8.
 * 
 * @return
 */
public static Collection<Converter<?, ?>> getConvertersToRegister() {

    if (!JAVA_8_IS_PRESENT) {
        return Collections.emptySet();
    }

    List<Converter<?, ?>> converters = new ArrayList<Converter<?, ?>>();
    converters.add(DateToLocalDateTimeConverter.INSTANCE);
    converters.add(LocalDateTimeToDateConverter.INSTANCE);
    converters.add(DateToLocalDateConverter.INSTANCE);
    converters.add(LocalDateToDateConverter.INSTANCE);
    converters.add(DateToLocalTimeConverter.INSTANCE);
    converters.add(LocalTimeToDateConverter.INSTANCE);
    converters.add(DateToInstantConverter.INSTANCE);
    converters.add(InstantToDateConverter.INSTANCE);

    return converters;
}
项目:spring-data-solr    文件:CustomConversions.java   
private void registerConversion(Object converter) {
    Class<?> type = converter.getClass();
    boolean isWriting = type.isAnnotationPresent(WritingConverter.class);
    boolean isReading = type.isAnnotationPresent(ReadingConverter.class);

    if (!isReading && !isWriting) {
        isReading = true;
        isWriting = true;
    }

    if (converter instanceof GenericConverter) {
        GenericConverter genericConverter = (GenericConverter) converter;
        for (ConvertiblePair pair : genericConverter.getConvertibleTypes()) {
            register(new ConvertibleContext(pair, isReading, isWriting));
        }
    } else if (converter instanceof Converter) {
        Class<?>[] arguments = GenericTypeResolver.resolveTypeArguments(converter.getClass(), Converter.class);
        register(new ConvertibleContext(arguments[0], arguments[1], isReading, isWriting));
    } else {
        throw new IllegalArgumentException("Unsupported Converter type! Expected either GenericConverter if Converter.");
    }
}
项目:spring-data-crate    文件:CustomConversions.java   
/**
 * Populates the given {@link GenericConversionService} with the converters registered.
 *
 * @param conversionService the service to register.
 */
public void registerConvertersIn(final GenericConversionService conversionService) {
  for (Object converter : converters) {
    boolean added = false;

    if (converter instanceof Converter) {
      conversionService.addConverter((Converter<?, ?>) converter);
      added = true;
    }

    if (converter instanceof ConverterFactory) {
      conversionService.addConverterFactory((ConverterFactory<?, ?>) converter);
      added = true;
    }

    if (converter instanceof GenericConverter) {
      conversionService.addConverter((GenericConverter) converter);
      added = true;
    }

    if (!added) {
      throw new IllegalArgumentException("Given set contains element that is neither Converter nor ConverterFactory!");
    }
  }
}
项目:spring-data-crate    文件:CustomConversions.java   
/**
 * Registers a conversion for the given converter. Inspects either generics or the convertible pairs returned
 * by a {@link GenericConverter}.
 *
 * @param converter the converter to register.
 */
private void registerConversion(final Object converter) {
  Class<?> type = converter.getClass();
  boolean isWriting = type.isAnnotationPresent(WritingConverter.class);
  boolean isReading = type.isAnnotationPresent(ReadingConverter.class);

  if (converter instanceof GenericConverter) {
    GenericConverter genericConverter = (GenericConverter) converter;
    for (GenericConverter.ConvertiblePair pair : genericConverter.getConvertibleTypes()) {
      register(new ConverterRegistration(pair, isReading, isWriting));
    }
  } else if (converter instanceof Converter) {
    Class<?>[] arguments = GenericTypeResolver.resolveTypeArguments(converter.getClass(), Converter.class);
    register(new ConverterRegistration(arguments[0], arguments[1], isReading, isWriting));
  } else {
    throw new IllegalArgumentException("Unsupported Converter type!");
  }
}
项目:class-guard    文件:ConversionServiceFactory.java   
/**
 * Register the given Converter objects with the given target ConverterRegistry.
 * @param converters the converter objects: implementing {@link Converter},
 * {@link ConverterFactory}, or {@link GenericConverter}
 * @param registry the target registry
 */
public static void registerConverters(Set<?> converters, ConverterRegistry registry) {
    if (converters != null) {
        for (Object converter : converters) {
            if (converter instanceof GenericConverter) {
                registry.addConverter((GenericConverter) converter);
            }
            else if (converter instanceof Converter<?, ?>) {
                registry.addConverter((Converter<?, ?>) converter);
            }
            else if (converter instanceof ConverterFactory<?, ?>) {
                registry.addConverterFactory((ConverterFactory<?, ?>) converter);
            }
            else {
                throw new IllegalArgumentException("Each converter object must implement one of the " +
                        "Converter, ConverterFactory, or GenericConverter interfaces");
            }
        }
    }
}
项目:class-guard    文件:DefaultListableBeanFactoryTests.java   
@Test
public void testCustomConverter() {
    DefaultListableBeanFactory lbf = new DefaultListableBeanFactory();
    GenericConversionService conversionService = new DefaultConversionService();
    conversionService.addConverter(new Converter<String, Float>() {
        @Override
        public Float convert(String source) {
            try {
                NumberFormat nf = NumberFormat.getInstance(Locale.GERMAN);
                return nf.parse(source).floatValue();
            }
            catch (ParseException ex) {
                throw new IllegalArgumentException(ex);
            }
        }
    });
    lbf.setConversionService(conversionService);
    MutablePropertyValues pvs = new MutablePropertyValues();
    pvs.add("myFloat", "1,1");
    RootBeanDefinition bd = new RootBeanDefinition(TestBean.class);
    bd.setPropertyValues(pvs);
    lbf.registerBeanDefinition("testBean", bd);
    TestBean testBean = (TestBean) lbf.getBean("testBean");
    assertTrue(testBean.getMyFloat().floatValue() == 1.1f);
}
项目:data-prep    文件:Converters.java   
@Bean
public Converter<String, ErrorCode> errorCodeConverter() {
    // Don't convert to lambda -> cause issue for Spring to infer source and target types.
    return new Converter<String, ErrorCode>() {
        @Override
        public ErrorCode convert(String source) {
            ObjectMapper mapper = new ObjectMapper();
            try {
                return mapper.readerFor(JsonErrorCode.class).readValue(source);
            } catch (Exception e) {
                LOGGER.trace("Unable to read error code from '{}'", source, e);

                // Build a JSON error code out of "source" (mostly likely a error code as string).
                final ErrorCodeDto errorCodeDto = new ErrorCodeDto();
                errorCodeDto.setCode(source);
                errorCodeDto.setHttpStatus(CommonErrorCodes.UNEXPECTED_EXCEPTION.getHttpStatus());
                errorCodeDto.setGroup(CommonErrorCodes.UNEXPECTED_EXCEPTION.getGroup());
                errorCodeDto.setProduct(CommonErrorCodes.UNEXPECTED_EXCEPTION.getProduct());
                return errorCodeDto;
            }
        }
    };
}
项目:spring-oauth-example    文件:ConvertersConfiguration.java   
/**
 * Converter for the format yyyy-MM-dd HH:mm:ss
 *
 * Currently needed for the approval revoke form that needs to bind the expiresAt and lastUpdatedAt
 * dates of an approval.
 */
@Bean
public Converter<String, Date> stringDateConverter() {
    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
    // We can not use a lambda here since Spring can't detect the generic types that way.
    return new Converter<String, Date>() {
        @Override
        public Date convert(String source) {
            if (source == null) {
                throw new IllegalArgumentException("Date string may not be null");
            }
            try {
                return sdf.parse(source);
            } catch (ParseException e) {
                throw new IllegalArgumentException(e);
            }
        }
    };
}
项目:spring-data-solr    文件:CustomConversions.java   
/**
 * Register custom converters within given {@link GenericConversionService}
 * 
 * @param conversionService must not be null
 */
public void registerConvertersIn(GenericConversionService conversionService) {
    Assert.notNull(conversionService);

    for (Object converter : converters) {
        if (converter instanceof Converter) {
            conversionService.addConverter((Converter<?, ?>) converter);
        } else if (converter instanceof ConverterFactory) {
            conversionService.addConverterFactory((ConverterFactory<?, ?>) converter);
        } else if (converter instanceof GenericConverter) {
            conversionService.addConverter((GenericConverter) converter);
        } else {
            throw new IllegalArgumentException("Given object '" + converter
                    + "' expected to be a Converter, ConverterFactory or GenericeConverter!");
        }
    }
}
项目:jhipster-microservices-example    文件:CloudDatabaseConfiguration.java   
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();
    converterList.add(DateToZonedDateTimeConverter.INSTANCE);
    converterList.add(ZonedDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converterList);
}
项目:jhipster-microservices-example    文件:DatabaseConfiguration.java   
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converters = new ArrayList<>();
    converters.add(DateToZonedDateTimeConverter.INSTANCE);
    converters.add(ZonedDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converters);
}
项目:configx    文件:ConfigPropertyResolver.java   
/**
 * Initialize default ConversionService
 *
 * @return
 */
private ConfigurableConversionService getDefaultConversionService() {
    if (this.defaultConversionService == null) {
        DefaultConversionService conversionService = new DefaultConversionService();
        this.applicationContext.getAutowireCapableBeanFactory().autowireBean(this);
        for (Converter<?, ?> converter : this.converters) {
            conversionService.addConverter(converter);
        }
        for (GenericConverter genericConverter : this.genericConverters) {
            conversionService.addConverter(genericConverter);
        }
        this.defaultConversionService = conversionService;
    }
    return this.defaultConversionService;
}
项目:happy-news    文件:MongoConfig.java   
@Override
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();
    AuthenticationReadConverter authenticationReadConverter = new AuthenticationReadConverter();
    converterList.add(authenticationReadConverter);
    return new CustomConversions(converterList);
}
项目:happy-news    文件:TestConfig.java   
@Override
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();
    AuthenticationReadConverter authenticationReadConverter = new AuthenticationReadConverter();
    converterList.add(authenticationReadConverter);
    return new CustomConversions(converterList);
}
项目:spring-data-examples    文件:ConverterConfiguration.java   
@Override
public CustomConversions customConversions() {

    List<Converter<?, ?>> converters = new ArrayList<>();
    converters.add(new PersonWriteConverter());
    converters.add(new PersonReadConverter());
    converters.add(new CustomAddressbookReadConverter());

    return new CustomConversions(converters);
}
项目:sentry    文件:CloudDatabaseConfiguration.java   
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();
    converterList.add(DateToZonedDateTimeConverter.INSTANCE);
    converterList.add(ZonedDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converterList);
}
项目:sentry    文件:DatabaseConfiguration.java   
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converters = new ArrayList<>();
    converters.add(DateToZonedDateTimeConverter.INSTANCE);
    converters.add(ZonedDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converters);
}
项目:state-channels    文件:PropertyConvertersConfig.java   
@Bean(name="conversionService")
public ConversionServiceFactoryBean getConversionService() {
    ConversionServiceFactoryBean bean = new ConversionServiceFactoryBean();

    Set<Converter> converters = new HashSet<>();

    converters.add(new DurationConverter());
    converters.add(new AddressConverter());

    bean.setConverters(converters);
    return bean;
}
项目:spring-data-tarantool    文件:JdkTarantoolSerializer.java   
public JdkTarantoolSerializer(Converter<Object, byte[]> serializer, Converter<byte[], Object> deserializer) {
    Assert.notNull("Serializer must not be null");
    Assert.notNull("Deserializer must not be null");

    this.serializer = serializer;
    this.deserializer = deserializer;
}
项目:spring-data-tarantool    文件:PlainTarantoolSerializer.java   
public PlainTarantoolSerializer(Class<T> desiredClass, ConfigurableConversionService conversionService) {
    this.desiredClass = desiredClass;
    this.conversionService = conversionService;

    conversionService.addConverter(Date.class, Number.class, (Converter<Date, Number>) Date::getTime);
    conversionService.addConverter(Number.class, Date.class, (Converter<Number, Date>) it -> new Date(it.longValue()));
}
项目:spring-data-tarantool    文件:CustomConversions.java   
/**
 * Populates the given {@link GenericConversionService} with the convertes registered.
 *
 * @param conversionService
 */
public void registerConvertersIn(GenericConversionService conversionService) {

    for (Object converter : converters) {

        boolean added = false;

        if (converter instanceof Converter) {
            conversionService.addConverter((Converter<?, ?>) converter);
            added = true;
        }

        if (converter instanceof ConverterFactory) {
            conversionService.addConverterFactory((ConverterFactory<?, ?>) converter);
            added = true;
        }

        if (converter instanceof GenericConverter) {
            conversionService.addConverter((GenericConverter) converter);
            added = true;
        }

        if (!added) {
            throw new IllegalArgumentException(
                    "Given set contains element that is neither Converter nor ConverterFactory!");
        }
    }
}
项目:spring-data-tarantool    文件:BinaryConverters.java   
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
public <T extends Enum<?>> Converter<String, T> getConverter(Class<T> targetType) {

    Class<?> enumType = targetType;
    while (enumType != null && !enumType.isEnum()) {
        enumType = enumType.getSuperclass();
    }
    if (enumType == null) {
        throw new IllegalArgumentException("The target type " + targetType.getName() + " does not refer to an enum");
    }
    return new StringToEnum(enumType);
}
项目:spring-io    文件:CloudDatabaseConfiguration.java   
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();
    converterList.add(DateToZonedDateTimeConverter.INSTANCE);
    converterList.add(ZonedDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converterList);
}
项目:spring-io    文件:DatabaseConfiguration.java   
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converters = new ArrayList<>();
    converters.add(DateToZonedDateTimeConverter.INSTANCE);
    converters.add(ZonedDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converters);
}
项目:devoxxus-jhipster-microservices-demo    文件:CloudDatabaseConfiguration.java   
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converterList = new ArrayList<>();
    converterList.add(DateToZonedDateTimeConverter.INSTANCE);
    converterList.add(ZonedDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converterList);
}
项目:devoxxus-jhipster-microservices-demo    文件:DatabaseConfiguration.java   
@Bean
public CustomConversions customConversions() {
    List<Converter<?, ?>> converters = new ArrayList<>();
    converters.add(DateToZonedDateTimeConverter.INSTANCE);
    converters.add(ZonedDateTimeToDateConverter.INSTANCE);
    return new CustomConversions(converters);
}
项目:spring-session-data-mongodb    文件:JdkMongoSessionConverter.java   
public JdkMongoSessionConverter(Converter<Object, byte[]> serializer,
        Converter<byte[], Object> deserializer, Duration maxInactiveInterval) {
    Assert.notNull(serializer, "serializer cannot be null");
    Assert.notNull(deserializer, "deserializer cannot be null");
    Assert.notNull(maxInactiveInterval, "maxInactiveInterval cannot be null");
    this.serializer = serializer;
    this.deserializer = deserializer;
    this.maxInactiveInterval = maxInactiveInterval;
}