Example usage for java.math BigInteger getClass

List of usage examples for java.math BigInteger getClass

Introduction

In this page you can find the example usage for java.math BigInteger getClass.

Prototype

@HotSpotIntrinsicCandidate
public final native Class<?> getClass();

Source Link

Document

Returns the runtime class of this Object .

Usage

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithArrayTest.java

@Test
public void testConfigurationPropertiesWithBigIntegerArray() {
    ConfigurationPropertiesWithArray config = prepareConfigurationPropertiesWithArray();

    BigInteger bigIntegerValue = config.bigIntegerArray[0];

    assertEquals(BigInteger.class, bigIntegerValue.getClass());
    assertEquals(3, config.bigIntegerArray.length);
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithArrayTest.java

@Test
public void testConfigurationXMLWithBigIntegerArray() {
    ConfigurationXMLWithArray config = prepareConfigurationXMLWithArray();

    BigInteger bigIntegerValue = config.bigIntegerArray[0];

    assertEquals(BigInteger.class, bigIntegerValue.getClass());
    assertEquals(3, config.bigIntegerArray.length);
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithListTest.java

@Test
public void testConfigurationPropertiesWithBigIntegerList() {
    ConfigurationPropertiesWithList config = prepareConfigurationPropertiesWithList();

    BigInteger bigIntegerValue = config.bigIntegerList.get(0);

    assertEquals(BigInteger.class, bigIntegerValue.getClass());
    assertEquals(3, config.bigIntegerList.size());
}

From source file:br.gov.frameworkdemoiselle.internal.configuration.ConfigurationLoaderWithListTest.java

@Test
public void testConfigurationXMLWithBigIntegerList() {
    ConfigurationXMLWithList config = prepareConfigurationXMLWithList();

    BigInteger bigIntegerValue = config.bigIntegerList.get(0);

    assertEquals(BigInteger.class, bigIntegerValue.getClass());
    assertEquals(3, config.bigIntegerList.size());
}

From source file:org.kuali.rice.core.api.criteria.CriteriaIntegerValue.java

/**
 * Since BigInteger is not technically immutable we defensively copy when needed.
 *
 * see Effective Java 2nd ed. page 79 for details.
 *
 * @param val the big integer to check// w  ww.  ja v a2  s  .  c o m
 * @return the safe BigInteger
 */
private static BigInteger safeInstance(BigInteger val) {
    if (val.getClass() != BigInteger.class) {
        return new BigInteger(val.toByteArray());
    }
    return val;
}