Java Code Examples for cn.hutool.core.collection.CollectionUtil#newArrayList()

The following examples show how to use cn.hutool.core.collection.CollectionUtil#newArrayList() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Override
public MenuService create(Throwable throwable) {
    return roleIds -> {
        log.error("调用findByRoleCodes异常:{}", roleIds, throwable);
        return CollectionUtil.newArrayList();
    };
}
 
Example 2
@Override
public MenuService create(Throwable throwable) {
    return roleIds -> {
        log.error("调用findByRoleCodes异常:{}", roleIds, throwable);
        return CollectionUtil.newArrayList();
    };
}
 
Example 3
@Override
public boolean check(Object[] permissions) {
    ShiroUser user = ShiroKit.getUser();
    if (null == user) {
        return false;
    }
    ArrayList<Object> objects = CollectionUtil.newArrayList(permissions);
    String join = CollectionUtil.join(objects, ",");
    if (ShiroKit.hasAnyRoles(join)) {
        return true;
    }
    return false;
}
 
Example 4
@Override
public boolean check(String[] roleNames) {
    LoginUser user = LoginContextHolder.getContext().getUser();
    if (null == user) {
        return false;
    }
    ArrayList<String> objects = CollectionUtil.newArrayList(roleNames);
    String join = CollectionUtil.join(objects, ",");
    if (LoginContextHolder.getContext().hasAnyRoles(join)) {
        return true;
    }
    return false;
}
 
Example 5
Source Project: bitchat   File: AbstractSessionManager.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public List<Session> getAllSessions() {
    return CollectionUtil.newArrayList(allSession());
}