Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个这样的枚举:
public enum Operation { ACK(1, false, false), NACK(255, false, false); ... }
现在我有松散的值说255, false, false,我想从中检索一个NACK枚举。
255
false
NACK
我需要一个函数f,以便:
f
f(255, false, false) returns NACK f(1, false, false) returns ACK
我该怎么做呢?