当前位置: 首页>>代码示例>>Java>>正文


Java NumberToShort类代码示例

本文整理汇总了Java中com.threewks.gaetools.transformer.numeric.NumberToShort的典型用法代码示例。如果您正苦于以下问题:Java NumberToShort类的具体用法?Java NumberToShort怎么用?Java NumberToShort使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


NumberToShort类属于com.threewks.gaetools.transformer.numeric包,在下文中一共展示了NumberToShort类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createWithDefaults

import com.threewks.gaetools.transformer.numeric.NumberToShort; //导入依赖的package包/类
public static TransformerManager createWithDefaults() {
    TransformerManager transformerManager = createEmpty();

    // numeric types
    transformerManager.register(String.class, Byte.class, new StringToByte());
    transformerManager.register(String.class, Integer.class, new StringToInteger());
    transformerManager.register(String.class, Long.class, new StringToLong());
    transformerManager.register(String.class, Short.class, new StringToShort());
    transformerManager.register(String.class, Float.class, new StringToFloat());
    transformerManager.register(String.class, Double.class, new StringToDouble());
    transformerManager.register(String.class, BigDecimal.class, new StringToBigDecimal());
    transformerManager.register(String.class, BigInteger.class, new StringToBigInteger());
    transformerManager.register(String.class, Number.class, new StringToNumber());
    transformerManager.register(Byte.class, String.class, new ByteToString());
    transformerManager.register(Long.class, String.class, new LongToString());
    transformerManager.register(Long.class, BigDecimal.class, new LongToBigDecimal());
    transformerManager.register(Integer.class, String.class, new IntegerToString());
    transformerManager.register(Integer.class, BigDecimal.class, new IntegerToBigDecimal());
    transformerManager.register(Short.class, String.class, new ShortToString());
    transformerManager.register(Double.class, String.class, new DoubleToString());
    transformerManager.register(Double.class, BigDecimal.class, new DoubleToBigDecimal());
    transformerManager.register(Float.class, String.class, new FloatToString());
    transformerManager.register(Float.class, BigDecimal.class, new FloatToBigDecimal());
    transformerManager.register(BigDecimal.class, String.class, new BigDecimalToString());
    transformerManager.register(BigInteger.class, String.class, new BigIntegerToString());
    transformerManager.register(Number.class, String.class, new NumberToString());
    transformerManager.register(Number.class, Float.class, new NumberToFloat());
    transformerManager.register(Number.class, Double.class, new NumberToDouble());
    transformerManager.register(Number.class, Integer.class, new NumberToInteger());
    transformerManager.register(Number.class, Long.class, new NumberToLong());
    transformerManager.register(Number.class, Short.class, new NumberToShort());
    transformerManager.register(Number.class, BigInteger.class, new NumberToBigInteger());
    transformerManager.register(Number.class, BigDecimal.class, new NumberToBigDecimal());
    transformerManager.register(Number.class, AtomicInteger.class, new NumberToAtomicInteger());
    transformerManager.register(Number.class, AtomicLong.class, new NumberToAtomicLong());

    // string/character types
    transformerManager.register(Character.class, String.class, new CharToString());
    transformerManager.register(String.class, Character.class, new StringToChar());

    // date types
    transformerManager.register(String.class, DateTime.class, new StringToDateTime());
    transformerManager.register(String.class, Date.class, new StringToDate());
    transformerManager.register(String.class, ReadableInstant.class, new StringToReadableInstant());
    transformerManager.register(DateTime.class, String.class, new DateTimeToString());
    transformerManager.register(DateTime.class, Long.class, new DateTimeToLong());
    transformerManager.register(DateTime.class, BigDecimal.class, new DateTimeToBigDecimal());
    transformerManager.register(DateTime.class, Date.class, new DateTimeToDate());
    transformerManager.register(Date.class, String.class, new DateToString());
    transformerManager.register(Date.class, DateTime.class, new DateToDateTime());
    transformerManager.register(Date.class, Long.class, new DateToLong());
    transformerManager.register(ReadableInstant.class, String.class, new ReadableInstantToString());
    transformerManager.register(ReadableInstant.class, Long.class, new ReadableInstantToLong());
    transformerManager.register(ReadableInstant.class, Date.class, new ReadableInstantToDate());
    transformerManager.register(Object.class, DateTime.class, new ObjectToDateTime());
    transformerManager.register(Long.class, DateTime.class, new LongToDateTime());
    transformerManager.register(BigDecimal.class, DateTime.class, new BigDecimalToDateTime());
    transformerManager.register(Long.class, Date.class, new LongToDate());

    // discrete types
    transformerManager.register(Boolean.class, String.class, new BooleanToString());
    transformerManager.register(Enum.class, String.class, new EnumToString());
    transformerManager.register(String.class, Boolean.class, new StringToBoolean());

    // url types
    transformerManager.register(URL.class, String.class, new UrlToString());
    transformerManager.register(URI.class, String.class, new UriToString());
    transformerManager.register(String.class, URL.class, new StringToUrl());
    transformerManager.register(String.class, URI.class, new StringToUri());

    // uuids
    transformerManager.register(UUID.class, String.class, new UUIDToString());
    transformerManager.register(String.class, UUID.class, new StringToUUID());

    // data types
    transformerManager.register(byte[].class, InputStream.class, new ByteArrayToInputStream());
    transformerManager.register(String.class, InputStream.class, new StringToInputStream());
    transformerManager.register(InputStream.class, byte[].class, new InputStreamToByteArray());

    return transformerManager;
}
 
开发者ID:monPlan,项目名称:springboot-spwa-gae-demo,代码行数:82,代码来源:TransformerManager.java


注:本文中的com.threewks.gaetools.transformer.numeric.NumberToShort类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。