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

The following examples show how to use cn.hutool.core.collection.CollectionUtil#newArrayList() . 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
Source File: MenuServiceFallbackFactory.java    From microservices-platform with Apache License 2.0 5 votes vote down vote up
@Override
public MenuService create(Throwable throwable) {
    return roleIds -> {
        log.error("调用findByRoleCodes异常:{}", roleIds, throwable);
        return CollectionUtil.newArrayList();
    };
}
 
Example 2
Source File: MenuServiceFallbackFactory.java    From microservices-platform with Apache License 2.0 5 votes vote down vote up
@Override
public MenuService create(Throwable throwable) {
    return roleIds -> {
        log.error("调用findByRoleCodes异常:{}", roleIds, throwable);
        return CollectionUtil.newArrayList();
    };
}
 
Example 3
Source File: PermissionCheckServiceServiceImpl.java    From WebStack-Guns with MIT License 5 votes vote down vote up
@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
Source File: AuthServiceImpl.java    From Guns with GNU Lesser General Public License v3.0 5 votes vote down vote up
@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 File: AbstractSessionManager.java    From bitchat with Apache License 2.0 4 votes vote down vote up
@Override
public List<Session> getAllSessions() {
    return CollectionUtil.newArrayList(allSession());
}