Logo
Developer SDK
Version 1.9.632.913d652c-152450467.
ConversionUtility Class Reference

Static Public Member Functions

static Locale getLocale ()
 
static void setLocale (Locale locale)
 
static BigDecimal parseAmount (String amt)
 
static BigDecimal parseAmount (double amt)
 
static BigDecimal parseAmount (int amt)
 
static BigDecimal prepareBigDecimal (BigDecimal bigDecimal)
 
static void writeBigDecimalToParcel (BigDecimal value, Parcel dest)
 
static BigDecimal readBigDecimalFromParcel (Parcel in)
 
static void writeIntegerToParcel (Integer value, Parcel dest)
 
static Integer convertToInteger (BigDecimal val)
 
static String convertToString (BigDecimal val)
 
static Integer readIntegerFromParcel (Parcel in)
 
static void writeBoolToParcel (boolean value, Parcel dest)
 
static boolean readBoolFromParcel (Parcel in)
 
static< T extends Enum< T > void writeEnumToParcel (Parcel dest, T enumValue)
 
static< T extends Enum< T > T readEnumFromParcel (Parcel in, Class< T > enumType)
 
static< T extends Enum< T > void writeEnumArrayToParcel (Parcel dest, T[] enumArray)
 
static< T extends Enum< T > T [] readEnumArrayFromParcel (Parcel in, Class< T > enumType)
 
static< T extends ICpToJson > JSONArray buildListToCpJson (List< T > candidateList)
 

Static Public Attributes

static final MathContext DEFAULT_DECIMAL_MATH_CONTEXT = new MathContext(DECIMAL_SCALE, ROUNDING_MODE)
 
static final BigDecimal DEFAULT_BIG_DECIMAL
 

Detailed Description

Enables conversion between types.

Definition at line 19 of file ConversionUtility.java.

Member Function Documentation

◆ buildListToCpJson()

static <T extends ICpToJson> JSONArray buildListToCpJson ( List< T >  candidateList)
static

Build JSONObject based on all nested objects in target list

Parameters
candidateListlist with objects for building to Json
<T>objects type which extends ICpToJson
Returns
JSONArray with ready to cp messages Json objects

Definition at line 203 of file ConversionUtility.java.

◆ convertToInteger()

static Integer convertToInteger ( BigDecimal  val)
static

Converts BigDecimal value to integer, using ROUNDING_MODE.

Definition at line 95 of file ConversionUtility.java.

◆ convertToString()

static String convertToString ( BigDecimal  val)
static

Converts BigDecimal value to a well-formatted string, using the current locale's number of currency digits.

Definition at line 106 of file ConversionUtility.java.

◆ parseAmount() [1/3]

static BigDecimal parseAmount ( String  amt)
static

Enables conversion from a String amount to the appropriate format for a payment or transaction.

Definition at line 41 of file ConversionUtility.java.

◆ parseAmount() [2/3]

static BigDecimal parseAmount ( double  amt)
static

Enables conversion from a double amount to the appropriate format for a payment or transaction.

Definition at line 49 of file ConversionUtility.java.

◆ parseAmount() [3/3]

static BigDecimal parseAmount ( int  amt)
static

Enables conversion from an int amount to the appropriate format for a payment or transaction.

Definition at line 53 of file ConversionUtility.java.

◆ prepareBigDecimal()

static BigDecimal prepareBigDecimal ( BigDecimal  bigDecimal)
static

Returns a BigDecimal with the correct scale and rounding mode.

Definition at line 58 of file ConversionUtility.java.

Member Data Documentation

◆ DEFAULT_BIG_DECIMAL

final BigDecimal DEFAULT_BIG_DECIMAL
static
Initial value:
= new BigDecimal("0.0000",
DEFAULT_DECIMAL_MATH_CONTEXT)

Definition at line 24 of file ConversionUtility.java.


The documentation for this class was generated from the following file:

This document is the confidential property of Verifone, Inc. Any reproduction or distribution of this document, in whole or in part, or the disclosure of any of the information contained herein, without the prior written consent of Verifone, Inc. is prohibited. This document and any supplemental material supplied as part of any review must be returned to Verifone, Inc. upon request. Notice: This document may go through material revisions over time. While the Company will make every effort to keep readers updated as changes occur, care must be taken by the reader to make sure they are reading the latest version. Version numbers appear in the title page and revision history page of this document. All rights reserved. Verifone, the Verifone logo are either trademarks or registered trademarks of Verifone in the United States and/or other countries. All other trademarks or brand names are properties of their respective holders.