Tabnine Logo
Class.isPrimitive
Code IndexAdd Tabnine to your IDE (free)

How to use
isPrimitive
method
in
java.lang.Class

Best Java code snippets using java.lang.Class.isPrimitive (Showing top 20 results out of 26,577)

origin: google/guava

/**
 * Returns true if this type is one of the nine primitive types (including {@code void}).
 *
 * @since 15.0
 */
public final boolean isPrimitive() {
 return (runtimeType instanceof Class) && ((Class<?>) runtimeType).isPrimitive();
}
origin: apache/incubator-dubbo

private static boolean isPrimitive(Class<?> cls) {
  return cls.isPrimitive() || cls == Boolean.class || cls == Byte.class
      || cls == Character.class || cls == Short.class || cls == Integer.class
      || cls == Long.class || cls == Float.class || cls == Double.class
      || cls == String.class || cls == Date.class || cls == Class.class;
}
origin: apache/incubator-dubbo

private static boolean isPrimitive(Class<?> cls) {
  return cls.isPrimitive() || cls == Boolean.class || cls == Byte.class
      || cls == Character.class || cls == Short.class || cls == Integer.class
      || cls == Long.class || cls == Float.class || cls == Double.class
      || cls == String.class || cls == Date.class || cls == Class.class;
}
origin: apache/incubator-dubbo

public static boolean isPrimitive(Class<?> type) {
  return type.isPrimitive()
      || type == String.class
      || type == Character.class
      || type == Boolean.class
      || type == Byte.class
      || type == Short.class
      || type == Integer.class
      || type == Long.class
      || type == Float.class
      || type == Double.class
      || type == Object.class;
}
origin: apache/incubator-dubbo

public static boolean isPrimitive(Class<?> type) {
  return type.isPrimitive()
      || type == String.class
      || type == Character.class
      || type == Boolean.class
      || type == Byte.class
      || type == Short.class
      || type == Integer.class
      || type == Long.class
      || type == Float.class
      || type == Double.class
      || type == Object.class;
}
origin: square/retrofit

static void checkNotPrimitive(Type type) {
 if (type instanceof Class<?> && ((Class<?>) type).isPrimitive()) {
  throw new IllegalArgumentException();
 }
}
origin: google/guava

private static void disallowPrimitiveType(Type[] types, String usedAs) {
 for (Type type : types) {
  if (type instanceof Class) {
   Class<?> cls = (Class<?>) type;
   checkArgument(!cls.isPrimitive(), "Primitive type '%s' used as %s", cls, usedAs);
  }
 }
}
origin: spring-projects/spring-framework

/**
 * Resolve the given class if it is a primitive class,
 * returning the corresponding primitive wrapper type instead.
 * @param clazz the class to check
 * @return the original class, or a primitive wrapper for the original primitive type
 */
public static Class<?> resolvePrimitiveIfNecessary(Class<?> clazz) {
  Assert.notNull(clazz, "Class must not be null");
  return (clazz.isPrimitive() && clazz != void.class ? primitiveTypeToWrapperMap.get(clazz) : clazz);
}
origin: apache/incubator-dubbo

private static boolean isPrimitive(Class<?> cls) {
  return cls.isPrimitive() || cls == String.class || cls == Boolean.class || cls == Character.class
      || Number.class.isAssignableFrom(cls) || Date.class.isAssignableFrom(cls);
}
origin: apache/incubator-dubbo

public static boolean isPrimitive(Class<?> cls) {
  return cls.isPrimitive() || cls == String.class || cls == Boolean.class || cls == Character.class
      || Number.class.isAssignableFrom(cls) || Date.class.isAssignableFrom(cls);
}
origin: apache/incubator-dubbo

private static boolean isPrimitive(Class<?> cls) {
  return cls.isPrimitive() || cls == String.class || cls == Boolean.class || cls == Character.class
      || Number.class.isAssignableFrom(cls) || Date.class.isAssignableFrom(cls);
}
origin: apache/incubator-dubbo

public static boolean isPrimitive(Class<?> cls) {
  return cls.isPrimitive() || cls == String.class || cls == Boolean.class || cls == Character.class
      || Number.class.isAssignableFrom(cls) || Date.class.isAssignableFrom(cls);
}
origin: spring-projects/spring-framework

/**
 * Check if the given class represents an array of primitives,
 * i.e. boolean, byte, char, short, int, long, float, or double.
 * @param clazz the class to check
 * @return whether the given class is a primitive array class
 */
public static boolean isPrimitiveArray(Class<?> clazz) {
  Assert.notNull(clazz, "Class must not be null");
  return (clazz.isArray() && clazz.getComponentType().isPrimitive());
}
origin: spring-projects/spring-framework

/**
 * Is this type a primitive type?
 */
public boolean isPrimitive() {
  return getType().isPrimitive();
}
origin: spring-projects/spring-framework

private int countNumberOfUnboundPrimitiveArguments() {
  int count = 0;
  for (int i = 0; i < this.argumentTypes.length; i++) {
    if (isUnbound(i) && this.argumentTypes[i].isPrimitive()) {
      count++;
    }
  }
  return count;
}
origin: spring-projects/spring-framework

/**
 * Check if the given class represents a primitive (i.e. boolean, byte,
 * char, short, int, long, float, or double) or a primitive wrapper
 * (i.e. Boolean, Byte, Character, Short, Integer, Long, Float, or Double).
 * @param clazz the class to check
 * @return whether the given class is a primitive or primitive wrapper class
 */
public static boolean isPrimitiveOrWrapper(Class<?> clazz) {
  Assert.notNull(clazz, "Class must not be null");
  return (clazz.isPrimitive() || isPrimitiveWrapper(clazz));
}
origin: spring-projects/spring-framework

/**
 * Determine if the given type is assignable from the given value,
 * assuming setting by reflection. Considers primitive wrapper classes
 * as assignable to the corresponding primitive types.
 * @param type the target type
 * @param value the value that should be assigned to the type
 * @return if the type is assignable from the value
 */
public static boolean isAssignableValue(Class<?> type, @Nullable Object value) {
  Assert.notNull(type, "Type must not be null");
  return (value != null ? isAssignable(type, value.getClass()) : !type.isPrimitive());
}
origin: google/guava

static boolean isPrimitiveOrNullable(Parameter param) {
 return param.getType().getRawType().isPrimitive() || isNullable(param);
}
origin: apache/incubator-dubbo

  @Override
  protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException {
    Class<?> clazz = desc.forClass();
    if (clazz.isPrimitive() || clazz.isArray()) {
      write(0);
      super.writeClassDescriptor(desc);
    } else {
      write(1);
      writeUTF(desc.getName());
    }
  }
}
origin: apache/incubator-dubbo

  @Override
  protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException {
    Class<?> clazz = desc.forClass();
    if (clazz.isPrimitive() || clazz.isArray()) {
      write(0);
      super.writeClassDescriptor(desc);
    } else {
      write(1);
      writeUTF(desc.getName());
    }
  }
}
java.langClassisPrimitive

Javadoc

Tests whether this Class represents a primitive type.

Popular methods of Class

  • getName
    Returns the name of the class represented by this Class. For a description of the format which is us
  • getSimpleName
  • getClassLoader
  • isAssignableFrom
    Determines if the class or interface represented by this Class object is either the same as, or is a
  • forName
    Returns the Class object associated with the class or interface with the given string name, using th
  • newInstance
    Returns a new instance of the class represented by this Class, created by invoking the default (that
  • getMethod
    Returns a Method object that reflects the specified public member method of the class or interface r
  • getResourceAsStream
  • getSuperclass
    Returns the Class representing the superclass of the entity (class, interface, primitive type or voi
  • getConstructor
  • cast
    Casts an object to the class or interface represented by this Class object.
  • isInstance
  • cast,
  • isInstance,
  • getCanonicalName,
  • getDeclaredField,
  • isArray,
  • getAnnotation,
  • getDeclaredFields,
  • getResource,
  • getDeclaredMethod,
  • getMethods

Popular in Java

  • Making http post requests using okhttp
  • scheduleAtFixedRate (Timer)
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • BorderLayout (java.awt)
    A border layout lays out a container, arranging and resizing its components to fit in five regions:
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JFileChooser (javax.swing)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now