I see that the class of a lambda is isSynthetic() && !isLocalOrAnonymousClass()
, but I presume that the same may be true for proxy classes.
Of course, I could check that getDeclaredMethods().length == 1
and apply regexp
to the class name.
However I want to know if there is a more elegant and robust option to find out if a given object is a lambda.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…