Package com.fasterxml.jackson.datatype.jsr310

# Class DecimalUtils

java.lang.Object
com.fasterxml.jackson.datatype.jsr310.DecimalUtils

public final class DecimalUtils extends Object
Utilities to aid in the translation of decimal types to/from multiple parts.

Since:
  2.2
Author:
  Nick Williams

## Method Summary

Modifier and Type
Method
Description
`static int`
`extractNanosecondDecimal(BigDecimal value, long integer)`
Deprecated.
due to potential unbounded latency on some JRE releases.
`static <T> T`
`extractSecondsAndNanos(BigDecimal seconds, BiFunction<Long,Integer,T> convert)`
Extracts the seconds and nanoseconds component of `seconds` as `long` and `int` values, passing them to the given converter.
`static BigDecimal`
`toBigDecimal(long seconds, int nanoseconds)`
Factory method for constructing `BigDecimal` out of second, nano-second components.
`static String`
`toDecimal(long seconds, int nanoseconds)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Method Details

### toDecimal

public static String toDecimal(long seconds, int nanoseconds)

### toBigDecimal

public static BigDecimal toBigDecimal(long seconds, int nanoseconds)
Factory method for constructing `BigDecimal` out of second, nano-second components.

Since:
  2.8

### extractNanosecondDecimal

@Deprecated public static int extractNanosecondDecimal(BigDecimal value, long integer)
Deprecated.
due to potential unbounded latency on some JRE releases.

### extractSecondsAndNanos

public static <T> T extractSecondsAndNanos(BigDecimal seconds, BiFunction<Long,Integer,T> convert)
Extracts the seconds and nanoseconds component of `seconds` as `long` and `int` values, passing them to the given converter. The implementation avoids latency issues present on some JRE releases.

Since:
  2.9.8