Package propel.core.userTypes

Examples of propel.core.userTypes.Int128


    if (targetType.equals(Duration.class))
      return new Duration(number.longValue());
    if (targetType.equals(Period.class))
      return new Period(number.longValue());
    if (targetType.equals(Int128.class))
      return new Int128(number.toString());
    if (targetType.equals(UnsignedByte.class))
      return new UnsignedByte((short) (number.byteValue() & 0xFF));
    if (targetType.equals(UnsignedShort.class))
      return new UnsignedShort((int) (number.shortValue() & 0xFFFF));
    if (targetType.equals(UnsignedInteger.class))
View Full Code Here


    if (targetType.equals(Duration.class))
      return new Duration((long) ch);
    if (targetType.equals(Period.class))
      return new Period((long) ch);
    if (targetType.equals(Int128.class))
      return new Int128(Integer.valueOf(ch).toString());
    if (targetType.equals(UnsignedByte.class))
      return new UnsignedByte((byte) ch);
    if (targetType.equals(UnsignedShort.class))
      return new UnsignedShort(ch);
    if (targetType.equals(UnsignedInteger.class))
View Full Code Here

    if (targetType.equals(Duration.class))
      return bool ? new Duration(1) : new Duration(0);
    if (targetType.equals(Period.class))
      return bool ? new Period(1) : new Period(0);
    if (targetType.equals(Int128.class))
      return bool ? new Int128("1") : new Int128("0");
    if (targetType.equals(UnsignedByte.class))
      return bool ? new UnsignedByte((byte) 1) : new UnsignedByte((byte) 0);
    if (targetType.equals(UnsignedShort.class))
      return bool ? new UnsignedShort(1) : new UnsignedShort(0);
    if (targetType.equals(UnsignedInteger.class))
View Full Code Here

    if (targetType.equals(Duration.class))
      return new Duration(number.longValue());
    if (targetType.equals(Period.class))
      return new Period(number.longValue());
    if (targetType.equals(Int128.class))
      return new Int128(number.toString());
    if (targetType.equals(UnsignedByte.class))
      return new UnsignedByte((short) (number.byteValue() & 0xFF));
    if (targetType.equals(UnsignedShort.class))
      return new UnsignedShort((int) (number.shortValue() & 0xFFFF));
    if (targetType.equals(UnsignedInteger.class))
View Full Code Here

    if (targetType.equals(Duration.class))
      return new Duration((long) ch);
    if (targetType.equals(Period.class))
      return new Period((long) ch);
    if (targetType.equals(Int128.class))
      return new Int128(Integer.valueOf(ch).toString());
    if (targetType.equals(UnsignedByte.class))
      return new UnsignedByte((byte) ch);
    if (targetType.equals(UnsignedShort.class))
      return new UnsignedShort(ch);
    if (targetType.equals(UnsignedInteger.class))
View Full Code Here

    if (targetType.equals(Duration.class))
      return bool ? new Duration(1) : new Duration(0);
    if (targetType.equals(Period.class))
      return bool ? new Period(1) : new Period(0);
    if (targetType.equals(Int128.class))
      return bool ? new Int128("1") : new Int128("0");
    if (targetType.equals(UnsignedByte.class))
      return bool ? new UnsignedByte((byte) 1) : new UnsignedByte((byte) 0);
    if (targetType.equals(UnsignedShort.class))
      return bool ? new UnsignedShort(1) : new UnsignedShort(0);
    if (targetType.equals(UnsignedInteger.class))
View Full Code Here

   */
  @Validate
  public static Int128 parseInt128(@NotNull final String value, @NotNull final Int128 minValue, @NotNull final Int128 maxValue)
  {
    // parse
    Int128 result;
    try
    {
      result = new Int128(value);
    }
    catch(Throwable e)
    {
      throw new NumberFormatException("The value '" + value + "' could not be parsed: " + e.getMessage());
    }

    // sanity check
    if (result.compareTo(minValue) < 0)
      throw new NumberFormatException("Value (" + result + ") was less than allowed minimum (" + minValue + ").");
    if (result.compareTo(maxValue) > 0)
      throw new NumberFormatException("Value (" + result + ") was more than allowed maximum (" + maxValue + ").");

    return result;
  }
View Full Code Here

TOP

Related Classes of propel.core.userTypes.Int128

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.