add new method for onLyfecycleMethod string

This commit is contained in:
Nitser 2019-10-01 16:59:52 +03:00
parent b69854ea63
commit d13e9a0c21
1 changed files with 14 additions and 0 deletions

View File

@ -257,6 +257,20 @@ public final class Lc {
+ (caller != null ? " of object " + caller.getClass().getSimpleName() + '(' + Integer.toHexString(caller.hashCode()) + ')' : "");
}
/**
* Returns line of code from where this method called.
*
* @param caller Object who is calling for code point;
* @param methodName String represents lifecycle method in which it was called
* @return String represents code point.
*/
@Non
@NonNull
public static String getCodePoint(@Nullable final Object caller, final String methodName) {
return methodName
+ (caller != null ? " of object " + caller.getClass().getSimpleName() + '(' + Integer.toHexString(caller.hashCode()) + ')' : "");
}
/**
* Prints stacktrace in log with specified tag.
*