MCPcopy Create free account
hub / github.com/EhsanTang/ApiManager / isEmpty

Method isEmpty

api/src/main/java/cn/crap/utils/MyString.java:25–37  ·  view source on GitHub ↗

判断对象是否为空 Object = null String = "","null","undefined" List size=0 @param object @return

(Object object)

Source from the content-addressed store, hash-verified

23 * @return
24 */
25 public static boolean isEmpty(Object object)
26 {
27 if(object instanceof String){
28 if(object == null||object.toString().trim().equals("")||object.toString().trim().equalsIgnoreCase("null")||object.toString().equals("undefined"))
29 return true;
30 }else if(object instanceof List<?>){
31 if(object == null ||((List<?>)object).size()==0)
32 return true;
33 }else if(object == null){
34 return true;
35 }
36 return false;
37 }
38
39 // 从request中获取值
40 public static String getValueFromRequest(HttpServletRequest request, String name){

Callers 15

v6ToV7Method · 0.95
generateMethod · 0.95
preHandleMethod · 0.95
canVisitMethod · 0.95
saveMethod · 0.95
findByMapMethod · 0.95
updateMethod · 0.95
deleteMethod · 0.95
isEqualsMethod · 0.95
getValueFromRequestMethod · 0.95
getMapMethod · 0.95
getStrMapMethod · 0.95

Calls

no outgoing calls

Tested by 1

v6ToV7Method · 0.76