当前位置: 首页>>代码示例>>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;未经允许,请勿转载。