Package net.minheur.potoflux.utils
Class LambdaUtils
java.lang.Object
net.minheur.potoflux.utils.LambdaUtils
Utility class for lambas, mainly used in loading mods
-
Method Summary
Modifier and TypeMethodDescriptionstatic ObjectgetCapturingInstance(Object lambda) Tries to extract caught instance (this) if the reference method is an instance reference.
WARNING: this works in most cases (method references non-static), but can fail for certains lambda types (ex : lambdas without captures).static MethodgetImplMethod(Serializable lambda) Gets the real method implemented by the reference / lambda.
-
Method Details
-
getImplMethod
Gets the real method implemented by the reference / lambda.- Returns:
- the method declared in the impl class (where it exists).
-
getCapturingInstance
Tries to extract caught instance (this) if the reference method is an instance reference.
WARNING: this works in most cases (method references non-static), but can fail for certains lambda types (ex : lambdas without captures).- Parameters:
lambda- method to extract from- Returns:
- caught instance
-