Convert

class Convert

Provides utility methods to handle type conversions

Types

Link copied to clipboard
open class Lazy
Lazy holder for creating a single instance of Gson on demand.

Functions

Link copied to clipboard
open fun toBoolean(source: Any): Boolean
Find the boolean value of the source
Link copied to clipboard
open fun toHexString(source: Array<Byte>): String
Converts the given array of bytes into hexadecimal string.
Link copied to clipboard
open fun toInt(source: Any): Int
open fun toInt(source: Any, defaultValue: Int): Int
Converts the given object into a primitive integer value.
Link copied to clipboard
open fun toJsonString(source: Any): String
Converts the given object into a JSON formatted string.
Link copied to clipboard
open fun <T> toList(source: Set<T>): List<T>
Converts a set of objects into a list of objects.
Link copied to clipboard
open fun toLong(source: Any): Long
open fun toLong(source: Any, defaultValue: Long): Long
Converts the given object into a primitive long value.
Link copied to clipboard
open fun toLongArray(source: Collection<out Number>): Array<Long>
Converts the give collection of Number objects into an array of Long objects.
open fun toLongArray(source: Array<Long>): Array<Long>
Converts the give array of primitive long values into an array of Long values.
Link copied to clipboard
open fun toPrimitiveLongArray(collection: Collection<out Number>): Array<Long>
Converts the give collection of Number objects into an array of primitive long values.
Link copied to clipboard
open fun <T> toSet(source: Array<T>): Set<T>
Converts the given primitive array of objects into a Set of objects.
open fun <T> toSet(source: Collection<T>): Set<T>
Converts the given Collection of objects into a Set of objects.
Link copied to clipboard
open fun toString(source: Any): String
open fun toString(source: Any, defaultValue: String): String
Converts the given object into a String object.
Link copied to clipboard
open fun toURI(source: Any): URI
Converts the give object to an URI object.