Class Method
java.lang.Object
com.weirddev.testme.intellij.template.context.Method
A class Method.
Date: 24/10/2016
- Author:
- Yaron Yamin
-
Constructor Summary
ConstructorsConstructorDescriptionMethod(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 TypeMethodDescriptionbooleanmethods 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 typeinthashCode()booleantrue - if method has parametersbooleantrue - if method has a return type and not voidbooleantrue - if method is abstractbooleantrue - when accessible from class under testbooleantrue - if method is a constructorbooleantrue - if method has default (package-private access modifier)booleanisGetter()true - if method is a getterbooleantrue - if method is inherited from parent classbooleantrue - if owner type is an interfacebooleanisNative()true - if method defined as nativebooleantrue - if method is overridden in child classbooleantrue - is Primary Constructor (relevant for Scala)booleantrue - if method has private modifierbooleantrue - if method has protected modifierbooleanisPublic()true - if method has public modifierbooleanisSetter()true - if method is a setterbooleanisStatic()true - if this is a static methodbooleantrue - if method is synthetically generated.booleantrue - 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
-