I want to write a method that takes as a parameter either result of Lambdaj.on() call or a string.
public static <T> void method(T arg) {
}
T can be String here.
Is it possible to determine if arg was created using Lambdaj.on() method?
I want to write a method that takes as a parameter either result of Lambdaj.on() call or a string.
public static <T> void method(T arg) {
}
T can be String here.
Is it possible to determine if arg was created using Lambdaj.on() method?
Copyright © 2021 Jogjafile Inc.
After reading Lambdaj source code (ArgumentsFactory.java for the most part) I can conclude that this is impossible.
Lambdaj stores data in a
WeakHashMap<Object, Argument<?>>, where key is what return things likeon(SomeCLass.classs).getX(). WeakHashMap compares objects using.hashCode()and.equals().