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


Java ImmutableList.copyOf方法代码示例

本文整理汇总了Java中com.google.common.collect.ImmutableList.copyOf方法的典型用法代码示例。如果您正苦于以下问题:Java ImmutableList.copyOf方法的具体用法?Java ImmutableList.copyOf怎么用?Java ImmutableList.copyOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.common.collect.ImmutableList的用法示例。


在下文中一共展示了ImmutableList.copyOf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: printFiltered

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
private static void printFiltered(final String contents, final DayOfWeek dayOfWeek) {
    final String nameOfDay = DAY_OF_WEEK_NAMES_MAP.get(dayOfWeek);
    final ImmutableList<String> lines = ImmutableList.copyOf(NEWLINE.split(contents));
    final int start = lines.indexOf(nameOfDay);
    if (start < 0) {
        logger.error("Not found for '{}' in pdf. (lines: {})", nameOfDay, lines);
        return;
    }
    logger.info("Menu for {}", dayOfWeek);
    lines.stream().skip(start).filter(line -> {
        final int idx = line.indexOf(' ');
        return (idx >= 0) && FOODS.contains(line.substring(0, idx));
    }).forEachOrdered(msg -> {
        logger.info("{}: {}", (Object[]) msg.split(" ", 2));
    });
}
 
开发者ID:tnovo,项目名称:which-food-uptec-cli,代码行数:17,代码来源:App.java

示例2: HologramAnimation

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
/**
 * Creates a new animation with the specified parameters.
 *
 * @param loop      Whether or not to loop the animation at its conclusion.
 * @param frameDelay The delay, in ticks.
 * @param frames    The frames to be displayed.
 */
public HologramAnimation(boolean loop, long frameDelay, long startDelay, long endDelay, HologramFrame... frames) {
    Preconditions.checkArgument(frameDelay >= 1, "Tick delay must be at least 1 (was {0})", frameDelay);
    Preconditions.checkNotNull(frames, "Frames");
    Preconditions.checkArgument(frames.length > 1, "Frame count must be greater than 1 (was {0})", frames.length);
    this.frames = ImmutableList.copyOf(frames);

    int largest = 0;
    for (HologramFrame frame : this.frames) {
        largest = Math.max(largest, frame.getHeight());
    }
    this.maxHeight = largest;

    this.loop = loop;
    this.frameDelay = frameDelay;
    this.startDelay = startDelay;
    this.endDelay = endDelay;
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:25,代码来源:HologramAnimation.java

示例3: getColumnNames

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
private ImmutableList<ColumnIdentifier> getColumnNames(
        final DatabaseConnectionGenerator connectionGenerator,
        final String tableName)
        throws AlgorithmExecutionException {
    String query = format("SELECT column_name FROM information_schema.columns WHERE table_name='%s'", getTableName(tableName));
    List<ColumnIdentifier> columnNames = new ArrayList<>();
    try (ResultSet resultSet = connectionGenerator.generateResultSetFromSql(query)) {
        while (resultSet.next()) {
            columnNames.add(new ColumnIdentifier(tableName, resultSet.getString("column_name")));
        }
    } catch (SQLException e) {
        throw new InputGenerationException(format("Error fetching column names of table %s", tableName), e);
    }
    return ImmutableList.copyOf(columnNames);
}
 
开发者ID:HPI-Information-Systems,项目名称:AdvancedDataProfilingSeminar,代码行数:16,代码来源:PostgresDataAccessObject.java

示例4: MockTeConstraintBasedLinkWeight

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
/**
 * Creates a new edge-weight function capable of evaluating links
 * on the basis of the specified constraints.
 *
 * @param constraints path constraints
 */
MockTeConstraintBasedLinkWeight(List<Constraint> constraints) {
    if (constraints == null) {
        this.constraints = Collections.emptyList();
    } else {
        this.constraints = ImmutableList.copyOf(constraints);
    }
}
 
开发者ID:shlee89,项目名称:athena,代码行数:14,代码来源:PathComputationTest.java

示例5: SimpleCaseExpression

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
private SimpleCaseExpression(Optional<NodeLocation> location, Expression operand, List<WhenClause> whenClauses, Optional<Expression> defaultValue)
{
    super(location);
    requireNonNull(operand, "operand is null");
    requireNonNull(whenClauses, "whenClauses is null");

    this.operand = operand;
    this.whenClauses = ImmutableList.copyOf(whenClauses);
    this.defaultValue = defaultValue;
}
 
开发者ID:dbiir,项目名称:rainbow,代码行数:11,代码来源:SimpleCaseExpression.java

示例6: getDecryptionProofs

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public List<DecryptionProof> getDecryptionProofs() {
    return ImmutableList.copyOf(decryptionProofs);
}
 
开发者ID:republique-et-canton-de-geneve,项目名称:chvote-protocol-poc,代码行数:4,代码来源:TallyData.java

示例7: of

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
/** Creates a chain. */
public static RelMetadataProvider of(List<RelMetadataProvider> list) {
  return new ChainedRelMetadataProvider(ImmutableList.copyOf(list));
}
 
开发者ID:dremio,项目名称:dremio-oss,代码行数:5,代码来源:ChainedRelMetadataProvider.java

示例8: getTupleEntityWriters

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
List<MessageBodyWriter<TupleEntity>> getTupleEntityWriters() {
  return ImmutableList.copyOf(tupleEntityWriters);
}
 
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:4,代码来源:SupportedMediaTypesScanner.java

示例9: TemplateComponent

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public TemplateComponent(MessageTemplate message, List<BaseComponent> with) {
    this.message = message;
    this.with = ImmutableList.copyOf(with);
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:5,代码来源:TemplateComponent.java

示例10: getS

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public List<BigInteger> getS() {
    return ImmutableList.copyOf(s);
}
 
开发者ID:republique-et-canton-de-geneve,项目名称:chvote-protocol-poc,代码行数:4,代码来源:NonInteractiveZKP.java

示例11: getQueuedTasks

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public ImmutableList<Runnable> getQueuedTasks() {
    return ImmutableList.copyOf(tasks);
}
 
开发者ID:telstra,项目名称:open-kilda,代码行数:4,代码来源:TestEventLoop.java

示例12: ProjectImportWizardController

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public ProjectImportWizardController(IWizard projectImportWizard) {
    // assemble configuration object that serves as the data model of the wizard
    Validator<File> projectDirValidator = Validators.and(
            Validators.requiredDirectoryValidator("Project root directory"),
            Validators.nonWorkspaceFolderValidator("Project root directory"));
    Validator<GradleDistributionWrapper> gradleDistributionValidator = GradleDistributionValidator.gradleDistributionValidator();
    Validator<Boolean> applyWorkingSetsValidator = Validators.nullValidator();
    Validator<List<String>> workingSetsValidator = Validators.nullValidator();
    Validator<File> gradleUserHomeValidator = Validators.optionalDirectoryValidator("Gradle user home");

    this.configuration = new ProjectImportConfiguration(projectDirValidator, gradleDistributionValidator, gradleUserHomeValidator, applyWorkingSetsValidator, workingSetsValidator);

    // initialize values from the persisted dialog settings
    IDialogSettings dialogSettings = projectImportWizard.getDialogSettings();
    Optional<File> projectDir = FileUtils.getAbsoluteFile(dialogSettings.get(SETTINGS_KEY_PROJECT_DIR));
    Optional<String> gradleDistributionType = Optional.fromNullable(Strings.emptyToNull(dialogSettings.get(SETTINGS_KEY_GRADLE_DISTRIBUTION_TYPE)));
    Optional<String> gradleDistributionConfiguration = Optional.fromNullable(Strings.emptyToNull(dialogSettings.get(SETTINGS_KEY_GRADLE_DISTRIBUTION_CONFIGURATION)));
    Optional<File> gradleUserHome = FileUtils.getAbsoluteFile(dialogSettings.get(SETTINGS_KEY_GRADLE_USER_HOME));
    boolean applyWorkingSets = dialogSettings.get(SETTINGS_KEY_APPLY_WORKING_SETS) != null && dialogSettings.getBoolean(SETTINGS_KEY_APPLY_WORKING_SETS);
    List<String> workingSets = ImmutableList.copyOf(CollectionsUtils.nullToEmpty(dialogSettings.getArray(SETTINGS_KEY_WORKING_SETS)));
    boolean buildScansEnabled = dialogSettings.getBoolean(SETTINGS_KEY_BUILD_SCANS);
    boolean offlineMode = dialogSettings.getBoolean(SETTINGS_KEY_OFFLINE_MODE);

    this.configuration.setProjectDir(projectDir.orNull());
    this.configuration.setOverwriteWorkspaceSettings(false);
    this.configuration.setGradleDistribution(createGradleDistribution(gradleDistributionType, gradleDistributionConfiguration));
    this.configuration.setGradleUserHome(gradleUserHome.orNull());
    this.configuration.setApplyWorkingSets(applyWorkingSets);
    this.configuration.setWorkingSets(workingSets);
    this.configuration.setBuildScansEnabled(buildScansEnabled);
    this.configuration.setOfflineMode(offlineMode);

    // store the values every time they change
    saveFilePropertyWhenChanged(dialogSettings, SETTINGS_KEY_PROJECT_DIR, this.configuration.getProjectDir());
    saveGradleWrapperPropertyWhenChanged(dialogSettings, this.configuration.getGradleDistribution());
    saveFilePropertyWhenChanged(dialogSettings, SETTINGS_KEY_GRADLE_USER_HOME, this.configuration.getGradleUserHome());
    saveBooleanPropertyWhenChanged(dialogSettings, SETTINGS_KEY_APPLY_WORKING_SETS, this.configuration.getApplyWorkingSets());
    saveStringArrayPropertyWhenChanged(dialogSettings, SETTINGS_KEY_WORKING_SETS, this.configuration.getWorkingSets());
    saveBooleanPropertyWhenChanged(dialogSettings, SETTINGS_KEY_BUILD_SCANS, this.configuration.getBuildScansEnabled());
    saveBooleanPropertyWhenChanged(dialogSettings, SETTINGS_KEY_OFFLINE_MODE, this.configuration.getOfflineMode());
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:42,代码来源:ProjectImportWizardController.java

示例13: getT_4

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public List<BigInteger> getT_4() {
    return ImmutableList.copyOf(t_4);
}
 
开发者ID:republique-et-canton-de-geneve,项目名称:chvote-protocol-poc,代码行数:4,代码来源:ShuffleProof.java

示例14: getPlayers

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
@Override
public List<Player> getPlayers() {
    return ImmutableList.copyOf(views.keySet());
}
 
开发者ID:OvercastNetwork,项目名称:ProjectAres,代码行数:5,代码来源:RenderedBossBar.java

示例15: MapTransaction

import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public MapTransaction(TransactionId transactionId, List<MapUpdate<K, V>> updates) {
    this.transactionId = transactionId;
    this.updates = ImmutableList.copyOf(updates);
}
 
开发者ID:shlee89,项目名称:athena,代码行数:5,代码来源:MapTransaction.java


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