Create conventions for T get(K keyLike)
variants
#665
Labels
discussion
changes that need discussion before being implemented
documentation
improvements or additions to documentation
It's been discussed a couple times in PR comments, I propose the following conventions:
I've seen
getOrNull
suggested for the first variant.I prefer
get
because I think one of them should be justget
, and this matchesjava.util.Map::get
.If only one single-param variant is present, I think
get
should be used regardless of which variant it is (getOrDefault
should always begetOrDefault
).Note that I'm not suggesting a convention for differentiating between methods that get values based on various different key-likes, such as
Identifier id
andint rawId
, which I don't think should be generalized into a convention.The text was updated successfully, but these errors were encountered: