當前位置: 首頁>>代碼示例>>Java>>正文


Java Iterables.toString方法代碼示例

本文整理匯總了Java中com.google.common.collect.Iterables.toString方法的典型用法代碼示例。如果您正苦於以下問題:Java Iterables.toString方法的具體用法?Java Iterables.toString怎麽用?Java Iterables.toString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.common.collect.Iterables的用法示例。


在下文中一共展示了Iterables.toString方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: restore

import com.google.common.collect.Iterables; //導入方法依賴的package包/類
/**
 * Creates a data source identical to the original.
 *
 * @throws DataTypeChangedException if the data type of the restored source is different from the saved one
 * @throws IllegalStateException    if the saved source type is not registered when this method is called
 */
@SuppressWarnings("unchecked")
public DataSource<T> restore() throws DataTypeChangedException, IllegalStateException {
  SourceType sourceType = getSourceType();
  if (SourceTypes.getDefault().isRegistered(sourceType)) {
    DataSource<T> restored = (DataSource<T>) sourceType.forUri(oldId);
    if (!possibleTypes.contains(restored.getDataType())) {
      throw new DataTypeChangedException(
          "The new data type is " + restored.getDataType() + ", was expecting one of: "
              + Iterables.toString(possibleTypes));
    }
    if (sourceType.getAvailableSourceUris().contains(oldId)) {
      // The restored source already existed at restoration time, no need to set its name or data
      return restored;
    }
    restored.nameProperty().set(name.get());
    restored.activeProperty().set(true);
    if (getData() == null && !Sources.getDefault().isRegistered(restored)) {
      // No data was saved, set it to the default value for its type
      restored.setData(restored.getDataType().getDefaultValue());
    } else {
      restored.setData(getData());
    }
    return restored;
  } else {
    throw new IllegalStateException("The source type " + sourceType.getName() + " is not registered");
  }
}
 
開發者ID:wpilibsuite,項目名稱:shuffleboard,代碼行數:34,代碼來源:DestroyedSource.java

示例2: getProjectNames

import com.google.common.collect.Iterables; //導入方法依賴的package包/類
private String getProjectNames(final Iterable<IBuildConfiguration> buildOrder) {
	return Iterables.toString(from(buildOrder).transform(c -> c.getProject().getName()));
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:4,代碼來源:ExternalLibraryBuilderHelper.java

示例3: toString

import com.google.common.collect.Iterables; //導入方法依賴的package包/類
@Override
public String toString() {
	return super.toString() + " " + Iterables.toString(projectNames);
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:5,代碼來源:ManualAssociationAwareWorkingSetManager.java


注:本文中的com.google.common.collect.Iterables.toString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。