Codota Logo
Method.getName
Code IndexAdd Codota to your IDE (free)

How to use
getName
method
in
java.lang.reflect.Method

Best Java code snippets using java.lang.reflect.Method.getName (Showing top 20 results out of 62,145)

  • Common ways to obtain Method
private void myMethod () {
Method m =
  • Codota IconClass clazz;clazz.getMethod("<changeme>")
  • Codota IconClass clazz;String name;Class[] parameterTypes;clazz.getMethod(name, parameterTypes)
  • Codota IconPropertyDescriptor pd;pd.getReadMethod()
  • Smart code suggestions by Codota
}
origin: spring-projects/spring-framework

protected boolean isMatch(Method method, String beanKey) {
  if (this.methodMappings != null) {
    Set<String> methodNames = this.methodMappings.get(beanKey);
    if (methodNames != null) {
      return methodNames.contains(method.getName());
    }
  }
  return (this.managedMethods != null && this.managedMethods.contains(method.getName()));
}
origin: square/retrofit

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

static RuntimeException methodError(Method method, @Nullable Throwable cause, String message,
  Object... args) {
 message = String.format(message, args);
 return new IllegalArgumentException(message
   + "\n    for method "
   + method.getDeclaringClass().getSimpleName()
   + "."
   + method.getName(), cause);
}
origin: spring-projects/spring-framework

@Override
@Nullable
protected Object getRawAttributeValue(Method attributeMethod) {
  return getRawAttributeValue(attributeMethod.getName());
}
origin: google/guava

 @Override
 public int compare(Method a, Method b) {
  return a.getName().compareTo(b.getName());
 }
});
origin: google/guava

/**
 * Identifies just enterIfXxx methods (a subset of {@link #isAnyEnter}), which are mostly like the
 * enterXxx methods but behave like tryEnterXxx in some scenarios.
 */
private static boolean isEnterIf(Method method) {
 return method.getName().startsWith("enterIf");
}
origin: google/guava

private static String nameFor(
  Method method, Scenario scenario, boolean fair, Timeout timeout, Outcome expectedOutcome) {
 return String.format(
   Locale.ROOT,
   "%s%s(%s)/%s->%s",
   method.getName(),
   fair ? "(fair)" : "(nonfair)",
   (timeout == null) ? "untimed" : timeout,
   scenario,
   expectedOutcome);
}
origin: spring-projects/spring-framework

  @Override
  public boolean matches(Method m, @Nullable Class<?> targetClass, Object... args) {
    boolean run = m.getName().contains(pattern);
    if (run) ++count;
    return run;
  }
});
origin: spring-projects/spring-framework

  @Override
  public boolean matches(Method m, @Nullable Class<?> targetClass) {
    return "haveBirthday".equals(m.getName());
  }
};
origin: google/guava

 @Override
 public int compare(Method m1, Method m2) {
  int nameComparison = m1.getName().compareTo(m2.getName());
  if (nameComparison != 0) {
   return nameComparison;
  } else {
   return Ints.compare(m1.getParameterTypes().length, m2.getParameterTypes().length);
  }
 }
});
origin: google/guava

SourceSinkTester(F factory, T data, String suiteName, String caseDesc, Method method) {
 super(method.getName());
 this.factory = checkNotNull(factory);
 this.data = checkNotNull(data);
 this.expected = checkNotNull(factory.getExpected(data));
 this.suiteName = checkNotNull(suiteName);
 this.caseDesc = checkNotNull(caseDesc);
}
origin: google/guava

private static void doTestMocking(RateLimiter mock) throws Exception {
 for (Method method : RateLimiter.class.getMethods()) {
  if (!isStatic(method.getModifiers())
    && !NOT_WORKING_ON_MOCKS.contains(method.getName())
    && !method.getDeclaringClass().equals(Object.class)) {
   method.invoke(mock, arbitraryParameters(method));
  }
 }
}
origin: google/guava

@GwtIncompatible // reflection
public void testAsMapBridgeMethods() {
 for (Method m : TreeMultimap.class.getMethods()) {
  if (m.getName().equals("asMap") && m.getReturnType().equals(SortedMap.class)) {
   return;
  }
 }
}
origin: google/guava

@GwtIncompatible // reflection
public void testKeySetBridgeMethods() {
 for (Method m : TreeMultimap.class.getMethods()) {
  if (m.getName().equals("keySet") && m.getReturnType().equals(SortedSet.class)) {
   return;
  }
 }
 fail("No bridge method found");
}
origin: google/guava

 @GwtIncompatible // reflection
 public void testGetBridgeMethods() {
  for (Method m : TreeMultimap.class.getMethods()) {
   if (m.getName().equals("get") && m.getReturnType().equals(SortedSet.class)) {
    return;
   }
  }
  fail("No bridge method found");
 }
}
origin: google/guava

 @Override
 public Object handleInvocation(Object proxy, Method method, Object[] args) {
  // Crude, but acceptable until we can use Java 8.  Other
  // methods have default implementations, and it is hard to
  // distinguish.
  if (method.getName().equals(JUF_METHODS.get(typeName))) {
   return getDefaultValue(type.method(method).getReturnType());
  }
  throw new IllegalStateException("Unexpected " + method + " invoked on " + proxy);
 }
});
origin: google/guava

MethodSignature(Method method) {
 name = method.getName();
 parameterTypes = Arrays.asList(method.getParameterTypes());
 typeSignature = new TypeSignature(method.getTypeParameters());
}
origin: google/guava

 @GwtIncompatible // reflection
 @AndroidIncompatible // Reflection bug, or actual binary compatibility problem?
 public void testElementSetBridgeMethods() {
  for (Method m : TreeMultiset.class.getMethods()) {
   if (m.getName().equals("elementSet") && m.getReturnType().equals(SortedSet.class)) {
    return;
   }
  }
  fail("No bridge method found");
 }
}
origin: google/guava

public void verifyBarPass(Method method, TwoArg bar) {
 try {
  new NullPointerTester().testMethod(bar, method);
 } catch (AssertionFailedError incorrectError) {
  String errorMessage =
    rootLocaleFormat("Should not have flagged method %s for %s", method.getName(), bar);
  assertNull(errorMessage, incorrectError);
 }
}
origin: google/guava

public void verifyBarFail(Method method, TwoArg bar) {
 try {
  new NullPointerTester().testMethod(bar, method);
 } catch (AssertionFailedError expected) {
  return; // good...we wanted a failure
 }
 String errorMessage =
   rootLocaleFormat("Should have flagged method %s for %s", method.getName(), bar);
 fail(errorMessage);
}
java.lang.reflectMethodgetName

Javadoc

Returns the name of the method represented by this Methodobject, as a String.

Popular methods of Method

  • invoke
    Returns the result of dynamically invoking this method. Equivalent to receiver.methodName(arg1, arg2
  • getParameterTypes
  • getReturnType
  • setAccessible
  • getDeclaringClass
  • getAnnotation
  • getModifiers
  • isAnnotationPresent
  • getGenericReturnType
    Returns the return type of this method as a Type instance.
  • getParameterAnnotations
  • getGenericParameterTypes
    Returns the parameter types as an array of Type instances, in declaration order. If this method has
  • isAccessible
  • getGenericParameterTypes,
  • isAccessible,
  • equals,
  • getAnnotations,
  • toString,
  • getExceptionTypes,
  • getParameterCount,
  • isBridge,
  • isSynthetic

Popular in Java

  • Finding current android device location
  • compareTo (BigDecimal)
  • findViewById (Activity)
  • putExtra (Intent)
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • ArrayList (java.util)
    Resizable-array implementation of the List interface. Implements all optional list operations, and p
  • Stack (java.util)
    The Stack class represents a last-in-first-out (LIFO) stack of objects. It extends class Vector with
  • Timer (java.util)
    A facility for threads to schedule tasks for future execution in a background thread. Tasks may be s
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • JCheckBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now