java.lang.Object
tech.deplant.java4ever.binding.generator.javapoet.MethodSpec

public final class MethodSpec extends Object
A generated constructor or method declaration.
  • Field Details

  • Method Details

    • methodBuilder

      public static MethodSpec.Builder methodBuilder(String name)
    • constructorBuilder

      public static MethodSpec.Builder constructorBuilder()
    • CompactConstructorBuilder

      public static MethodSpec.Builder CompactConstructorBuilder()
    • overriding

      public static MethodSpec.Builder overriding(ExecutableElement method)
      Returns a new method spec builder that overrides method.

      This will copy its visibility modifiers, type parameters, return type, parameterName, parameters, and throws declarations. An Override annotation will be added.

      Note that in JavaPoet 1.2 through 1.7 this method retained annotations from the method and parameters of the overridden method. Since JavaPoet 1.8 annotations must be added separately.

    • overriding

      public static MethodSpec.Builder overriding(ExecutableElement method, DeclaredType enclosing, Types types)
      Returns a new method spec builder that overrides method as a member of enclosing. This will resolve type parameters: for example overriding Comparable.compareTo(T) in a type that implements Comparable<Movie>, the T parameter will be resolved to Movie.

      This will copy its visibility modifiers, type parameters, return type, parameterName, parameters, and throws declarations. An Override annotation will be added.

      Note that in JavaPoet 1.2 through 1.7 this method retained annotations from the method and parameters of the overridden method. Since JavaPoet 1.8 annotations must be added separately.

    • hasModifier

      public boolean hasModifier(Modifier modifier)
    • isConstructor

      public boolean isConstructor()
    • isCompactConstructor

      public boolean isCompactConstructor()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toBuilder

      public MethodSpec.Builder toBuilder()