Class JvmMethodDescriptor

java.lang.Object
me.sbasalaev.tybyco.descriptors.JvmDescriptor
me.sbasalaev.tybyco.descriptors.JvmMethodDescriptor

public final class JvmMethodDescriptor extends JvmDescriptor
Descriptor of a Java method or constructor.
See Also:
  • Constructor Details

    • JvmMethodDescriptor

      public JvmMethodDescriptor(JvmTypeOrVoid returnType, List<JvmType> argumentTypes)
      Creates new method descriptor with given argument and return types.
    • JvmMethodDescriptor

      public JvmMethodDescriptor(JvmTypeOrVoid returnType, JvmType... argumentTypes)
      Creates new method descriptor with given argument and return types.
  • Method Details

    • argumentTypes

      public List<JvmType> argumentTypes()
      Types of the arguments of this method.
    • returnType

      public JvmTypeOrVoid returnType()
      Return type of this method or JvmVoid if it is void.
    • prepend

      public JvmMethodDescriptor prepend(JvmType... types)
      Returns method descriptor with given argument types added at the beginning.
    • append

      public JvmMethodDescriptor append(JvmType... types)
      Returns method descriptor with given argument types added at the end.
    • dropFirst

      public JvmMethodDescriptor dropFirst()
      Returns method descriptor with the first argument removed.
    • withReturnType

      public JvmMethodDescriptor withReturnType(JvmTypeOrVoid type)
      Returns method descriptor with the return type replaced by a given type.
    • isGeneric

      public boolean isGeneric()
      Description copied from class: JvmDescriptor
      Whether the signature for the descriptor has generic elements. This method returns true if the signature contains type arguments or type variables.
      Specified by:
      isGeneric in class JvmDescriptor
    • nonGenericString

      public String nonGenericString()
      Binary method descriptor.
      Specified by:
      nonGenericString in class JvmDescriptor
    • erasure

      public JvmMethodDescriptor erasure()
      The descriptor with erased types.
    • toString

      public String toString()
      String representation of this method descriptor.
      Specified by:
      toString in class JvmDescriptor
    • hashCode

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

      public boolean equals(@Nullable Object obj)
      Whether given object is equal to this method descriptor. Two method descriptors are equal if they have the same argument and return types.
      Overrides:
      equals in class Object