private void update(ColumnDefinition definition) { AtomicBoolean present = predefined.get(definition); if (present != null) { if (!present.get()) present.set(true); } else { extra.add(definition); } }
public PartitionColumns get() { PartitionColumns.Builder builder = PartitionColumns.builder(); for (Map.Entry<ColumnDefinition, AtomicBoolean> e : predefined.entrySet()) if (e.getValue().get()) builder.add(e.getKey()); return builder.addAll(extra).build(); }
ColumnsCollector(PartitionColumns columns) { for (ColumnDefinition def : columns.statics) predefined.put(def, new AtomicBoolean()); for (ColumnDefinition def : columns.regulars) predefined.put(def, new AtomicBoolean()); }