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

How to use
getName
method
in
java.lang.Class

Best Java code snippets using java.lang.Class.getName (Showing top 20 results out of 238,374)

origin: spring-projects/spring-framework

  @Override
  public String toString() {
    return (String.class.getName() + " -> @" + this.annotationType.getName() + " " +
        this.fieldType.getName() + ": " + this.annotationFormatterFactory);
  }
}
origin: stackoverflow.com

 private boolean isMyServiceRunning(Class<?> serviceClass) {
  ActivityManager manager = (ActivityManager) getSystemService(Context.ACTIVITY_SERVICE);
  for (RunningServiceInfo service : manager.getRunningServices(Integer.MAX_VALUE)) {
    if (serviceClass.getName().equals(service.service.getClassName())) {
      return true;
    }
  }
  return false;
}
origin: google/guava

/**
 * Returns human readable string representation of {@code type}.
 *
 * <p>The format is subject to change.
 */
static String toString(Type type) {
 return (type instanceof Class) ? ((Class<?>) type).getName() : type.toString();
}
origin: square/retrofit

 @Override public String toString() {
  return String.format("%s.%s() %s",
    method.getDeclaringClass().getName(), method.getName(), arguments);
 }
}
origin: ReactiveX/RxJava

  @Override
  public String toString() {
    return clazz.getName() + " " + name;
  }
}
origin: ReactiveX/RxJava

  @Override
  public String toString() {
    return clazz.getName() + " " + name;
  }
}
origin: google/guava

/**
 * Returns the package name of {@code clazz} according to the Java Language Specification (section
 * 6.7). Unlike {@link Class#getPackage}, this method only parses the class name, without
 * attempting to define the {@link Package} and hence load files.
 */
public static String getPackageName(Class<?> clazz) {
 return getPackageName(clazz.getName());
}
origin: spring-projects/spring-framework

@SuppressWarnings("unchecked")
static Class<? extends Annotation> getAnnotationType(AnnotationFormatterFactory<? extends Annotation> factory) {
  Class<? extends Annotation> annotationType = (Class<? extends Annotation>)
      GenericTypeResolver.resolveTypeArgument(factory.getClass(), AnnotationFormatterFactory.class);
  if (annotationType == null) {
    throw new IllegalArgumentException("Unable to extract parameterized Annotation type argument from " +
        "AnnotationFormatterFactory [" + factory.getClass().getName() +
        "]; does the factory parameterize the <A extends Annotation> generic type?");
  }
  return annotationType;
}
origin: spring-projects/spring-framework

@Override
public void destroy() {
  if (this.loadTimeWeaver instanceof InstrumentationLoadTimeWeaver) {
    if (logger.isDebugEnabled()) {
      logger.debug("Removing all registered transformers for class loader: " +
          this.loadTimeWeaver.getInstrumentableClassLoader().getClass().getName());
    }
    ((InstrumentationLoadTimeWeaver) this.loadTimeWeaver).removeTransformers();
  }
}
origin: google/guava

 @Override
 public boolean apply(StackTraceElement element) {
  return element.getClassName().equals(clazz.getName());
 }
};
origin: ReactiveX/RxJava

  /**
   * Report a ProtocolViolationException with a personalized message referencing
   * the simple type name of the consumer class and report it via
   * RxJavaPlugins.onError.
   * @param consumer the class of the consumer
   */
  public static void reportDoubleSubscription(Class<?> consumer) {
    RxJavaPlugins.onError(new ProtocolViolationException(composeMessage(consumer.getName())));
  }
}
origin: google/guava

private void runTestMethod(ClassLoader classLoader) throws Exception {
 Class<?> test = classLoader.loadClass(FuturesTest.class.getName());
 Object testInstance = test.newInstance();
 test.getMethod("setUp").invoke(testInstance);
 test.getMethod(getName()).invoke(testInstance);
 test.getMethod("tearDown").invoke(testInstance);
}
origin: google/guava

private void checkHelperVersion(ClassLoader classLoader, String expectedHelperClassName)
  throws Exception {
 // Make sure we are actually running with the expected helper implementation
 Class<?> abstractFutureClass = classLoader.loadClass(AbstractFuture.class.getName());
 Field helperField = abstractFutureClass.getDeclaredField("ATOMIC_HELPER");
 helperField.setAccessible(true);
 assertEquals(expectedHelperClassName, helperField.get(null).getClass().getSimpleName());
}
origin: google/guava

private void checkHelperVersion(ClassLoader classLoader, String expectedHelperClassName)
  throws Exception {
 // Make sure we are actually running with the expected helper implementation
 Class<?> abstractFutureClass = classLoader.loadClass(AggregateFutureState.class.getName());
 Field helperField = abstractFutureClass.getDeclaredField("ATOMIC_HELPER");
 helperField.setAccessible(true);
 assertEquals(expectedHelperClassName, helperField.get(null).getClass().getSimpleName());
}
origin: google/guava

private static ResourceInfo resourceInfo(Class<?> cls) {
 String resource = cls.getName().replace('.', '/') + ".class";
 ClassLoader loader = cls.getClassLoader();
 return ResourceInfo.of(resource, loader);
}
origin: google/guava

private static ClassPath.ClassInfo findClass(
  Iterable<ClassPath.ClassInfo> classes, Class<?> cls) {
 for (ClassPath.ClassInfo classInfo : classes) {
  if (classInfo.getName().equals(cls.getName())) {
   return classInfo;
  }
 }
 throw new AssertionError("failed to find " + cls);
}
origin: google/guava

private void checkStackTrace(ExecutionException e) {
 // Our call site for get() should be in the trace.
 int index = findStackFrame(e, getClass().getName(), "getExpectingExecutionException");
 assertThat(index).isNotEqualTo(0);
 // Above our method should be the call to get(). Don't assert on the class
 // because it could be some superclass.
 assertThat(e.getStackTrace()[index - 1].getMethodName()).isEqualTo("get");
}
origin: google/guava

public void testToString() {
 assertEquals(int[].class.getName(), Types.toString(int[].class));
 assertEquals(int[][].class.getName(), Types.toString(int[][].class));
 assertEquals(String[].class.getName(), Types.toString(String[].class));
 Type elementType = List.class.getTypeParameters()[0];
 assertEquals(elementType.toString(), Types.toString(elementType));
}
origin: google/guava

public <T> void testToString() {
 assertEquals(String.class.getName(), new TypeToken<String>() {}.toString());
 assertEquals("T", TypeToken.of(new TypeCapture<T>() {}.capture()).toString());
 assertEquals("java.lang.String", new Entry<String, Integer>() {}.keyType().toString());
}
origin: google/guava

public void testGetPackageName() throws Exception {
 assertEquals("java.lang", Reflection.getPackageName(Iterable.class));
 assertEquals("java", Reflection.getPackageName("java.MyType"));
 assertEquals("java.lang", Reflection.getPackageName(Iterable.class.getName()));
 assertEquals("", Reflection.getPackageName("NoPackage"));
 assertEquals("java.util", Reflection.getPackageName(Map.Entry.class));
}
java.langClassgetName

Javadoc

Returns the name of the class represented by this Class. For a description of the format which is used, see the class definition of Class.

Popular methods of Class

  • 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
    Finds a resource with a given name. The rules for searching resources associated with a given class
  • 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
  • getCanonicalName
    Returns the canonical name of the underlying class as defined by the Java Language Specification. Re
  • 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