本文整理汇总了Java中com.google.common.collect.Lists.asList方法的典型用法代码示例。如果您正苦于以下问题:Java Lists.asList方法的具体用法?Java Lists.asList怎么用?Java Lists.asList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.common.collect.Lists
的用法示例。
在下文中一共展示了Lists.asList方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initGlobal
import com.google.common.collect.Lists; //导入方法依赖的package包/类
/**
* Returns a new {@code PermissionCache} initialized with permission assignments
* from the {@code hbase.superuser} configuration key.
*/
private PermissionCache<Permission> initGlobal(Configuration conf) throws IOException {
UserProvider userProvider = UserProvider.instantiate(conf);
User user = userProvider.getCurrent();
if (user == null) {
throw new IOException("Unable to obtain the current user, " +
"authorization checks for internal operations will not work correctly!");
}
PermissionCache<Permission> newCache = new PermissionCache<Permission>();
String currentUser = user.getShortName();
// the system user is always included
List<String> superusers = Lists.asList(currentUser, conf.getStrings(
Superusers.SUPERUSER_CONF_KEY, new String[0]));
if (superusers != null) {
for (String name : superusers) {
if (AuthUtil.isGroupPrincipal(name)) {
newCache.putGroup(AuthUtil.getGroupName(name),
new Permission(Permission.Action.values()));
} else {
newCache.putUser(name, new Permission(Permission.Action.values()));
}
}
}
return newCache;
}
示例2: SetFetchCommand
import com.google.common.collect.Lists; //导入方法依赖的package包/类
public SetFetchCommand(Set<Long> ids, FetchDataItem fetchItem, FetchDataItem... otherFetchItems) {
this(ids, Lists.asList(fetchItem, otherFetchItems));
}
示例3: FetchCommand
import com.google.common.collect.Lists; //导入方法依赖的package包/类
public FetchCommand(long startId, Optional<Long> stopId, FetchDataItem fetchItem, FetchDataItem... otherFetchItems) {
this(startId, stopId, Lists.asList(fetchItem, otherFetchItems));
}
示例4: StreamingFetchCommand
import com.google.common.collect.Lists; //导入方法依赖的package包/类
public StreamingFetchCommand(long startId, Optional<Long> stopId, Function<ImapMessage, R> messageConsumer, FetchDataItem item, FetchDataItem... otherItems) {
this(startId, stopId, messageConsumer, Lists.asList(item, otherItems));
}
示例5: getProjectsByName
import com.google.common.collect.Lists; //导入方法依赖的package包/类
/**
* Returns with an array or project form the workspace. for the given subset of unique project names. Sugar for
*
* @param projectName
* the name of the project.
* @param otherName
* the name of another project.
* @param rest
* additional names of desired projects.
* @return an array of projects, could contain non-accessible project.
*/
protected IProject[] getProjectsByName(final String projectName, final String otherName, final String... rest) {
final List<String> projectNames = Lists.asList(projectName, otherName, rest);
final IProject[] projects = new IProject[projectNames.size()];
for (int i = 0; i < projects.length; i++) {
projects[i] = getProjectByName(projectNames.get(i));
}
return projects;
}
示例6: CompositeValidationIssueProcessor
import com.google.common.collect.Lists; //导入方法依赖的package包/类
/**
* Creates a new composite issue processor with the given sub processor arguments.
*
* @param first
* the first sub processor.
* @param others
* the other processor;
*/
public CompositeValidationIssueProcessor(final IValidationIssueProcessor first,
final IValidationIssueProcessor... others) {
processors = Lists.asList(first, others);
}
示例7: ExternalLibraryPreferenceModel
import com.google.common.collect.Lists; //导入方法依赖的package包/类
/**
* Creates a new model instance with the given location arguments.
*
* @param firstLocation
* the external library folder location.
* @param restLocations
* other external library folder locations.
*/
public ExternalLibraryPreferenceModel(final URI firstLocation, final URI... restLocations) {
this(Lists.asList(firstLocation, restLocations));
}
示例8: asList
import com.google.common.collect.Lists; //导入方法依赖的package包/类
/**
* 一个独立元素+一个数组组成新的list,只是一个View,不复制数组内容,而且独立元素在最前.
*
*
* 注意转换后的List不能写入, 否则抛出UnsupportedOperationException
*
* @see com.google.common.collect.Lists#asList(Object, Object[])
*/
public static <E> List<E> asList(E first, E[] rest) {
return Lists.asList(first, rest);
}