Class Method
java.lang.Object
com.weirddev.testme.intellij.template.context.Method
A class Method.
Date: 24/10/2016
- Author:
- Yaron Yamin
-
Constructor Summary
ConstructorDescriptionMethod
(String methodId, String name, Type returnType, String ownerClassCanonicalType, List<Param> methodParams, String methodExceptionTypes, boolean isPrivate, boolean isProtected, boolean isDefault, boolean isPublic, boolean isAbstract, boolean isNative, boolean isStatic, boolean isSetter, boolean isGetter, boolean constructor, boolean overridden, boolean inherited, boolean isInInterface, boolean isSynthetic, String propertyName, boolean accessible, boolean primaryConstructor, boolean testable) -
Method Summary
Modifier and TypeMethodDescriptionboolean
methods called directly from this methodFields affected (assigned to) by methods called from this method.references included in this method's implementationmethods called directly from this method or on the call stack from this method via other methods belonging to the same type hierarchymethod exception typesformatted method id.method argumentsmethods referenced from this method.getName()
method namemethod owner type cannonical namethe underlying field property name.Method's return typeint
hashCode()
boolean
true - if method has parametersboolean
true - if method has a return type and not voidboolean
true - if method is abstractboolean
true - when accessible from class under testboolean
true - if method is a constructorboolean
true - if method has default (package-private access modifier)boolean
isGetter()
true - if method is a getterboolean
true - if method is inherited from parent classboolean
true - if owner type is an interfaceboolean
isNative()
true - if method defined as nativeboolean
true - if method is overridden in child classboolean
true - is Primary Constructor (relevant for Scala)boolean
true - if method has private modifierboolean
true - if method has protected modifierboolean
isPublic()
true - if method has public modifierboolean
isSetter()
true - if method is a setterboolean
isStatic()
true - if this is a static methodboolean
true - if method is synthetically generated.boolean
true - method is accessible and can be relevant for unit testingtoString()
-
Constructor Details
-
Method
public Method(String methodId, String name, Type returnType, String ownerClassCanonicalType, List<Param> methodParams, String methodExceptionTypes, boolean isPrivate, boolean isProtected, boolean isDefault, boolean isPublic, boolean isAbstract, boolean isNative, boolean isStatic, boolean isSetter, boolean isGetter, boolean constructor, boolean overridden, boolean inherited, boolean isInInterface, boolean isSynthetic, String propertyName, boolean accessible, boolean primaryConstructor, boolean testable)
-
-
Method Details
-
hasReturn
public boolean hasReturn()true - if method has a return type and not void -
hasParams
public boolean hasParams()true - if method has parameters -
getMethodId
formatted method id. a string used to uniquely discriminate this method from others -
getName
method name -
getReturnType
Method's return type -
getOwnerClassCanonicalType
method owner type cannonical name -
getMethodParams
method arguments -
getMethodExceptionTypes
method exception types -
isPrivate
public boolean isPrivate()true - if method has private modifier -
isProtected
public boolean isProtected()true - if method has protected modifier -
isDefault
public boolean isDefault()true - if method has default (package-private access modifier) -
isPublic
public boolean isPublic()true - if method has public modifier -
isAbstract
public boolean isAbstract()true - if method is abstract -
isNative
public boolean isNative()true - if method defined as native -
isStatic
public boolean isStatic()true - if this is a static method -
isSetter
public boolean isSetter()true - if method is a setter -
isGetter
public boolean isGetter()true - if method is a getter -
isConstructor
public boolean isConstructor()true - if method is a constructor -
isOverridden
public boolean isOverridden()true - if method is overridden in child class -
isInherited
public boolean isInherited()true - if method is inherited from parent class -
isInInterface
public boolean isInInterface()true - if owner type is an interface -
isSynthetic
public boolean isSynthetic()true - if method is synthetically generated. common for scala methods -
getPropertyName
the underlying field property name. relevant for getter/setter -
isAccessible
public boolean isAccessible()true - when accessible from class under test -
isPrimaryConstructor
public boolean isPrimaryConstructor()true - is Primary Constructor (relevant for Scala) -
isTestable
public boolean isTestable()true - method is accessible and can be relevant for unit testing -
getDirectMethodCalls
methods called directly from this method -
getMethodCalls
methods called directly from this method or on the call stack from this method via other methods belonging to the same type hierarchy -
getMethodReferences
methods referenced from this method. i.e. SomeClassName::someMethodName -
getInternalReferences
references included in this method's implementation -
getIndirectlyAffectedFields
Fields affected (assigned to) by methods called from this method. currently calculated only for constructors. i.e. when delegating to other constructors -
equals
-
hashCode
public int hashCode() -
toString
-