sdk-common / com.tomtom.online.sdk.common.util / Preconditions / requireNonNull

requireNonNull

@NonNull static fun <T : Any!> requireNonNull(object: T, message: String!): T

Checks if the given object is not null. If the object is not null then it's returned, throw IllegalArgumentException otherwise with the specified message.

Parameters

object - T: will be checked if it is not null

message - String!: message used for the thrown exception

Exceptions

IllegalArgumentException - thrown if the object is null

Return
T: the object passed as arguments if it's not null