The question is basically just a search question and can be answered with a simple yes/no (yes is easier and should ideally be accompanied by a link to documentation, no is a tiny bit trickier and would need to be accompanied by some search description to show that no is indeed the right answer), one should really search before asking such questions. Otherwise, that simply translates to "do my work for me".
Apart from that, the question is ontopic in the sense that questions for the existence of language features are ontopic. People might have seen it as not very useful and typically "How to achieve something" questions are resulting in much more useful knowledge than "Does feature X exist" questions but that is not a reason to close. The closing of this question as unclear must have been a mistake. In the meantime, it was reopened.
People might also have seen it as a typical XY problem, i.e. your desire for this specific feature may hint that you assume this to be the solution to another problem you have, which may be solved better differently. Context (which has been added) is very useful for this.
The one thing this question is missing though is showing research, which might result in downvotes.
Pair
in Java. It can be implemented in about 5 lines of code. It's a common tool used by programmers, similar to an identity function.Pair
question is also in the exact same vein but it doesn't contain code. Are you saying that if it did it wouldn't be a practical issue?Pair
. The rest doesn't make it "more" of a pair - mostly boilerplate to make it "more Java"-y. Using Lombok annotations a "fully featured"Pair
is about as long. Still, I'd rather just consume this class than write it. But the point is - ability to implement something shouldn't make searching for a ready made one off-topic.Pair
type seems a lot more complex to me than what isx => x
in many languages. More importantly though, the identity question is framed that "it would solve my problem with a third-party library": there is a practical problem they want to solve, and the Identity is just an incidental piece – such questions are often XY. The other odd, very practical thing is that they "don't want to create a new .NET DLL"; creating program parts is usually the entire point of programming.