当前位置: 首页>>代码示例>>Java>>正文


Java Lists.asList方法代码示例

本文整理汇总了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;
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:30,代码来源:TableAuthManager.java

示例2: SetFetchCommand

import com.google.common.collect.Lists; //导入方法依赖的package包/类
public SetFetchCommand(Set<Long> ids, FetchDataItem fetchItem, FetchDataItem... otherFetchItems) {
  this(ids, Lists.asList(fetchItem, otherFetchItems));
}
 
开发者ID:HubSpot,项目名称:NioImapClient,代码行数:4,代码来源:SetFetchCommand.java

示例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));
}
 
开发者ID:HubSpot,项目名称:NioImapClient,代码行数:4,代码来源:FetchCommand.java

示例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));
}
 
开发者ID:HubSpot,项目名称:NioImapClient,代码行数:4,代码来源:StreamingFetchCommand.java

示例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;
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:20,代码来源:AbstractPluginUITest.java

示例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);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:13,代码来源:CompositeValidationIssueProcessor.java

示例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));
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:12,代码来源:ExternalLibraryPreferenceModel.java

示例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);
}
 
开发者ID:zhangjunfang,项目名称:util,代码行数:12,代码来源:ArrayUtil.java


注:本文中的com.google.common.collect.Lists.asList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。