本文整理汇总了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));
});
}
示例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;
}
示例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);
}
}
示例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;
}
示例6: getDecryptionProofs
import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public List<DecryptionProof> getDecryptionProofs() {
return ImmutableList.copyOf(decryptionProofs);
}
示例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));
}
示例8: getTupleEntityWriters
import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
List<MessageBodyWriter<TupleEntity>> getTupleEntityWriters() {
return ImmutableList.copyOf(tupleEntityWriters);
}
示例9: TemplateComponent
import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public TemplateComponent(MessageTemplate message, List<BaseComponent> with) {
this.message = message;
this.with = ImmutableList.copyOf(with);
}
示例10: getS
import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public List<BigInteger> getS() {
return ImmutableList.copyOf(s);
}
示例11: getQueuedTasks
import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public ImmutableList<Runnable> getQueuedTasks() {
return ImmutableList.copyOf(tasks);
}
示例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());
}
示例13: getT_4
import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
public List<BigInteger> getT_4() {
return ImmutableList.copyOf(t_4);
}
示例14: getPlayers
import com.google.common.collect.ImmutableList; //导入方法依赖的package包/类
@Override
public List<Player> getPlayers() {
return ImmutableList.copyOf(views.keySet());
}
示例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);
}