Top Description Fields Constructors Methods
org.freedesktop.dbus.utils

public final Class PrimitiveUtils

extends Object
Class Inheritance
Imports
java.util.Collections, .Map, java.util.concurrent.ConcurrentHashMap

Utility class containing methods dealing with object and primitive class types.
Author
hypfvieh
Since
5.1.1 - 2024-09-15

Field Summary

Modifier and TypeField and Description
private static final Map<Class<?>, Class<?>>
private static final Map<Class<?>, Class<?>>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Map<Class<?>, Class<?>>

Returns:

unmodifiable map
getPrimitiveToWrapperTypes
()

Map with all primitives and the corresponding wrapper type.

public static Map<Class<?>, Class<?>>

Returns:

unmodifiable map
getWrapperToPrimitiveTypes
()

Map with all wrapper types and the corresponding primitive.

public static boolean

Returns:

true if classes equal or both of compatible (wrapper) types, false otherwise or if any parameter is null
isCompatiblePrimitiveOrWrapper
(Class<?> _clz1, Class<?> _clz2)

Check if the given classes are equal or are equal wrapper types (e.g. byte == Byte).

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

PRIMITIVE_TO_WRAPPERback to summary
private static final Map<Class<?>, Class<?>> PRIMITIVE_TO_WRAPPER
WRAPPER_TO_PRIMITIVEback to summary
private static final Map<Class<?>, Class<?>> WRAPPER_TO_PRIMITIVE

Constructor Detail

PrimitiveUtilsback to summary
private PrimitiveUtils()

Method Detail

getPrimitiveToWrapperTypesback to summary
public static Map<Class<?>, Class<?>> getPrimitiveToWrapperTypes()

Map with all primitives and the corresponding wrapper type.

Returns:Map<Class<?>, Class<?>>

unmodifiable map

getWrapperToPrimitiveTypesback to summary
public static Map<Class<?>, Class<?>> getWrapperToPrimitiveTypes()

Map with all wrapper types and the corresponding primitive.

Returns:Map<Class<?>, Class<?>>

unmodifiable map

isCompatiblePrimitiveOrWrapperback to summary
public static boolean isCompatiblePrimitiveOrWrapper(Class<?> _clz1, Class<?> _clz2)

Check if the given classes are equal or are equal wrapper types (e.g. byte == Byte).

Returns:boolean

true if classes equal or both of compatible (wrapper) types, false otherwise or if any parameter is null