當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。