Package propel.core.userTypes

Examples of propel.core.userTypes.UnsignedLong


  @Validate
  public static UnsignedLong parseUInt64(@NotNull final String value, @NotNull final UnsignedLong minValue,
                                         @NotNull final UnsignedLong maxValue)
  {
    // parse
    UnsignedLong result;
    try
    {
      result = new UnsignedLong(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


    result = result.or(new BigInteger(CONSTANT.EMPTY_STRING + (value[0] & 0xff)).shiftLeft(56));
    result = result.or(new BigInteger(CONSTANT.EMPTY_STRING
        + (((value[1] & 0xff) << 48) | ((value[2] & 0xff) << 40) | ((value[3] & 0xff) << 32) | ((value[4] & 0xff) << 24)
            | ((value[5] & 0xff) << 16) | ((value[6] & 0xff) << 8) | (value[7] & 0xff))));

    return new UnsignedLong(result);
  }
View Full Code Here

    BigInteger hash = BigInteger.ZERO;

    for (byte b : ba)
      hash = hash.shiftLeft(5).add(hash).add(new BigInteger(Integer.toString(0xFF & b)));

    return new UnsignedLong(hash);
  }
View Full Code Here

TOP

Related Classes of propel.core.userTypes.UnsignedLong

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.