List of usage examples for com.google.common.collect ImmutableSet.Builder add
boolean add(E e);
From source file:org.apache.cassandra.utils.DirectorySizeCalculator.java
public void rebuildFileList() { assert path != null; ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for (File file : path.listFiles()) builder.add(file.getName()); size.set(0);/*from w w w . j a v a 2 s . com*/ alive = builder.build(); }
From source file:com.github.fge.jsonschema.keyword.validator.draftv3.PropertiesValidator.java
public PropertiesValidator(final JsonNode digest) { super("properties"); final ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for (final JsonNode element : digest.get("required")) builder.add(element.textValue()); required = builder.build();//from w ww .ja v a 2 s . c om }
From source file:tech.mcprison.prison.internal.events.inventory.InventoryDragEvent.java
public InventoryDragEvent(Viewable transaction, ItemStack newCursor, ItemStack oldCursor, boolean right, Map<Integer, ItemStack> slots) { super(transaction); this.right = right; this.newCursor = newCursor; this.oldCursor = oldCursor; this.slots = slots; ImmutableSet.Builder<Integer> b = ImmutableSet.builder(); for (Integer slot : slots.keySet()) { b.add(transaction.convertSlot(slot)); }//from w ww .ja v a2 s. c o m this.parsedSlots = b.build(); }
From source file:com.android.build.gradle.internal.dsl.AbiSplitOptions.java
@Override protected ImmutableSet<String> getAllowedValues() { ImmutableSet.Builder<String> builder = ImmutableSet.builder(); for (Abi abi : NdkHandler.getAbiList()) { builder.add(abi.getName()); }// w ww . ja v a 2 s . co m return builder.build(); }
From source file:org.sonar.java.ast.visitors.SyntaxHighlighterVisitor.java
public SyntaxHighlighterVisitor(SonarComponents sonarComponents) { this.sonarComponents = sonarComponents; ImmutableSet.Builder<String> keywordsBuilder = ImmutableSet.builder(); keywordsBuilder.add(JavaKeyword.keywordValues()); keywords = keywordsBuilder.build();// ww w.jav a 2 s . co m ImmutableMap.Builder<Tree.Kind, TypeOfText> typesByKindBuilder = ImmutableMap.builder(); typesByKindBuilder.put(Tree.Kind.STRING_LITERAL, TypeOfText.STRING); typesByKindBuilder.put(Tree.Kind.CHAR_LITERAL, TypeOfText.STRING); typesByKindBuilder.put(Tree.Kind.FLOAT_LITERAL, TypeOfText.CONSTANT); typesByKindBuilder.put(Tree.Kind.DOUBLE_LITERAL, TypeOfText.CONSTANT); typesByKindBuilder.put(Tree.Kind.LONG_LITERAL, TypeOfText.CONSTANT); typesByKindBuilder.put(Tree.Kind.INT_LITERAL, TypeOfText.CONSTANT); typesByKindBuilder.put(Tree.Kind.ANNOTATION, TypeOfText.ANNOTATION); typesByKind = typesByKindBuilder.build(); }
From source file:org.lenskit.specs.eval.SimulateSpec.java
/** * Get the output files for this task.//from w w w . j ava 2 s . c o m * @return The task's output files. */ @JsonIgnore public Set<Path> getOutputFiles() { ImmutableSet.Builder<Path> bld = ImmutableSet.builder(); if (outputFile != null) { bld.add(outputFile); } if (extendedOutputFile != null) { bld.add(extendedOutputFile); } return bld.build(); }
From source file:org.jclouds.googlecomputeengine.compute.functions.MachineTypeToHardware.java
private Iterable<Volume> collectVolumes(MachineType input) { ImmutableSet.Builder<Volume> volumes = ImmutableSet.builder(); for (MachineType.ScratchDisk disk : input.scratchDisks()) { volumes.add(new VolumeBuilder().type(Volume.Type.LOCAL).size(Float.valueOf(disk.diskGb())) .bootDevice(true).durable(false).build()); }/*w w w. j av a 2 s .c om*/ return volumes.build(); }
From source file:com.stackframe.sarariman.ContactsGlobalAudit.java
private Set<Contact> projectInvoiceContacts() throws SQLException { try (Connection connection = dataSource.getConnection(); PreparedStatement ps = connection.prepareStatement("SELECT contact FROM project_invoice_contacts"); ResultSet rs = ps.executeQuery();) { ImmutableSet.Builder<Contact> setBuilder = ImmutableSet.<Contact>builder(); while (rs.next()) { setBuilder.add(contacts.get(rs.getInt("contact"))); }/*from w w w.ja v a 2 s. c om*/ return setBuilder.build(); } }
From source file:com.googlesource.gerrit.plugins.github.group.GitHubGroupMembership.java
@Override public Set<UUID> intersection(Iterable<UUID> groupIds) { ImmutableSet.Builder<UUID> groups = new ImmutableSet.Builder<>(); for (UUID uuid : groupIds) { if (contains(uuid)) { groups.add(uuid); }//w w w .j a va 2 s.c om } return groups.build(); }
From source file:com.stackframe.sarariman.ContactsGlobalAudit.java
private Set<Contact> projectTimesheetContacts() throws SQLException { try (Connection connection = dataSource.getConnection(); PreparedStatement ps = connection .prepareStatement("SELECT contact FROM project_timesheet_contacts"); ResultSet rs = ps.executeQuery();) { ImmutableSet.Builder<Contact> setBuilder = ImmutableSet.<Contact>builder(); while (rs.next()) { setBuilder.add(contacts.get(rs.getInt("contact"))); }/*from w w w . ja va 2 s .c o m*/ return setBuilder.build(); } }