Top Description Constructors Methods
tools.jackson.databind.ext.javatime.util

public final Class DecimalUtils

extends Object
Class Inheritance
Imports
tools.jackson.core.io.NumberInput, java.math.BigDecimal, java.time.Instant, java.util.function.BiFunction

Utilities to aid in the translation of decimal types to/from multiple parts.
Author
Nick Williams

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static <T> T
extractSecondsAndNanos(BigDecimal seconds, BiFunction<Long, Integer, T> convert, boolean negativeAdjustment)

Extracts the seconds and nanoseconds component of seconds as long and int values, passing them to the given converter.

public static BigDecimal
toBigDecimal(long seconds, int nanoseconds)

Factory method for constructing BigDecimal out of second, nano-second components.

public static String
toDecimal(long seconds, int nanoseconds)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DecimalUtilsback to summary
private DecimalUtils()

Method Detail

extractSecondsAndNanosback to summary
public static <T> T extractSecondsAndNanos(BigDecimal seconds, BiFunction<Long, Integer, T> convert, boolean negativeAdjustment)

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.19
toBigDecimalback to summary
public static BigDecimal toBigDecimal(long seconds, int nanoseconds)

Factory method for constructing BigDecimal out of second, nano-second components.

toDecimalback to summary
public static String toDecimal(long seconds, int nanoseconds)