Package com.google.common.primitives
Class Primitives
- java.lang.Object
-
- com.google.common.primitives.Primitives
-
@Deprecated(since="2022-12-01") public final class Primitives extends java.lang.Object
Deprecated.The Google Guava Core Libraries are deprecated and will not be part of the AEM SDK after April 2023Contains static utility methods pertaining to primitive types and their corresponding wrapper types.- Since:
- 1.0
-
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static java.util.Set<java.lang.Class<?>>
allPrimitiveTypes()
Deprecated.Returns an immutable set of all nine primitive types (includingvoid
).static java.util.Set<java.lang.Class<?>>
allWrapperTypes()
Deprecated.Returns an immutable set of all nine primitive-wrapper types (includingVoid
).static boolean
isWrapperType(java.lang.Class<?> type)
Deprecated.Returnstrue
iftype
is one of the nine primitive-wrapper types, such asInteger
.static <T> java.lang.Class<T>
unwrap(java.lang.Class<T> type)
Deprecated.Returns the corresponding primitive type oftype
if it is a wrapper type; otherwise returnstype
itself.static <T> java.lang.Class<T>
wrap(java.lang.Class<T> type)
Deprecated.Returns the corresponding wrapper type oftype
if it is a primitive type; otherwise returnstype
itself.
-
-
-
Method Detail
-
allPrimitiveTypes
public static java.util.Set<java.lang.Class<?>> allPrimitiveTypes()
Deprecated.Returns an immutable set of all nine primitive types (includingvoid
). Note that a simpler way to test whether aClass
instance is a member of this set is to callClass.isPrimitive()
.- Since:
- 3.0
-
allWrapperTypes
public static java.util.Set<java.lang.Class<?>> allWrapperTypes()
Deprecated.Returns an immutable set of all nine primitive-wrapper types (includingVoid
).- Since:
- 3.0
-
isWrapperType
public static boolean isWrapperType(java.lang.Class<?> type)
Deprecated.Returnstrue
iftype
is one of the nine primitive-wrapper types, such asInteger
.- See Also:
Class.isPrimitive()
-
wrap
public static <T> java.lang.Class<T> wrap(java.lang.Class<T> type)
Deprecated.Returns the corresponding wrapper type oftype
if it is a primitive type; otherwise returnstype
itself. Idempotent.wrap(int.class) == Integer.class wrap(Integer.class) == Integer.class wrap(String.class) == String.class
-
unwrap
public static <T> java.lang.Class<T> unwrap(java.lang.Class<T> type)
Deprecated.Returns the corresponding primitive type oftype
if it is a wrapper type; otherwise returnstype
itself. Idempotent.unwrap(Integer.class) == int.class unwrap(int.class) == int.class unwrap(String.class) == String.class
-
-