I am building a servlet that needs to retrieve an Entity
from a GAE datastore, and then perform certain tasks depending on the entity's "STAGE" property, which is an integer. My code ends up looking like this:
switch( (int) (long) (Long) phrase.getProperty("STAGE")){
This works fine but the code is incredibly ugly and I can't help thinking this can be accomplished in a simpler and perhaps more efficient way.
Thank you, Billy
switch((((Number)phrase.getProperty(“ STAGE”))。intValue()){
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.