/*
public void setCollectionConfigPackage(Collection.CollectionConfigPackage collectionConfigPackage) {
this.collectionConfigPackage = collectionConfigPackage;
}
335213
public static ChaincodeCollectionConfiguration fromCollectionConfigPackage(Collection.CollectionConfigPackage collectionConfigPackage) throws InvalidArgumentException {

        // Sanity check
        if (collectionConfigPackage == null) {
            throw new InvalidArgumentException("collectionConfigPackage must be specified");
        }

        return new ChaincodeCollectionConfiguration(collectionConfigPackage);
    }
1170720
public void setPackage(PackageDeclaration pakage) {
        if (this.pakage != null) {
            updateReferences(this.pakage);
        }
        this.pakage = pakage;
        setAsParentNodeOf(pakage);
    }
304275
public void setConfigurationTemplates(java.util.Collection<String> configurationTemplates) {
        if (configurationTemplates == null) {
            this.configurationTemplates = null;
            return;
        }

        this.configurationTemplates = new com.amazonaws.internal.SdkInternalList<String>(configurationTemplates);
    }
1096658
public static void checkCollectionConfig(CollectionConfig collectionConfig,
                                             SplitBrainMergePolicyProvider mergePolicyProvider) {
        checkMergePolicy(collectionConfig, mergePolicyProvider, collectionConfig.getMergePolicyConfig().getPolicy());
    }
1320997
public void setCollections(java.util.Collection<HistoricalMetricData> collections) {
        if (collections == null) {
            this.collections = null;
            return;
        }

        this.collections = new java.util.ArrayList<HistoricalMetricData>(collections);
    }
1313383
public void setMediaPackageSettings(java.util.Collection<MediaPackageOutputDestinationSettings> mediaPackageSettings) {
        if (mediaPackageSettings == null) {
            this.mediaPackageSettings = null;
            return;
        }

        this.mediaPackageSettings = new java.util.ArrayList<MediaPackageOutputDestinationSettings>(mediaPackageSettings);
    }
81074
public void setConfig(Map<String, ? extends CacheConfig> config) {
        this.configMap = (Map<String, CacheConfig>) config;
    }
421145
def set_collection(self, collection):
        """"""
        self.beginResetModel()
        self.collection = collection
        self.sort_state = (-1, False)
        self.endResetModel()
292727
public void setRulesPackages(java.util.Collection<RulesPackage> rulesPackages) {
        if (rulesPackages == null) {
            this.rulesPackages = null;
            return;
        }

        this.rulesPackages = new java.util.ArrayList<RulesPackage>(rulesPackages);
    }
666468
public void setInstalledFeatures(Set<String> newInstalledFeatures, Set<String> newConfiguredFeatures, boolean configurationError) {
        Set<String> current = installedFeatures;
        if (!current.equals(newInstalledFeatures)) {
            isDirty = true;
        }
        if (newInstalledFeatures.isEmpty())
            installedFeatures = Collections.emptySet();
        else
            installedFeatures = Collections.unmodifiableSet(new HashSet<String>(newInstalledFeatures));

        current = configuredFeatures;
        if (!current.equals(newConfiguredFeatures)) {
            isDirty = true;
        }
        if (newConfiguredFeatures.isEmpty())
            configuredFeatures = Collections.emptySet();
        else
            configuredFeatures = Collections.unmodifiableSet(new HashSet<String>(newConfiguredFeatures));

        this.configurationError = configurationError;
    }
612923
void makePackage( PdfCollection collection ) {
        PdfDictionary catalog = reader.getCatalog();
       	catalog.put( PdfName.COLLECTION, collection );
    }
1199961
public void setModelPackageSummaryList(java.util.Collection<ModelPackageSummary> modelPackageSummaryList) {
        if (modelPackageSummaryList == null) {
            this.modelPackageSummaryList = null;
            return;
        }

        this.modelPackageSummaryList = new java.util.ArrayList<ModelPackageSummary>(modelPackageSummaryList);
    }
741347
@Override
  public <T> void updateCollectionSchema(CollectionSchemaUpdate update, String collectionName) {
    CollectionMetaData cmd = cmdMap.get(collectionName);
    @SuppressWarnings("unchecked")
    Map<Object, T> collection = (Map<Object, T>) collectionsRef.get().get(collectionName);
    if((null == cmd) || (null == collection)) {
      throw new InvalidJsonDbApiUsageException("Collection by name '" + collectionName + "' not found. Create collection first.");
    }
    boolean reloadCollectionAsSomethingChanged = false;
    //We only take care of ADD and RENAME, the deletes will be taken care of automatically.
    if (null != update) {
      Map<String, RenameOperation> renOps = update.getRenameOperations();
      if (renOps.size() > 0) {
        reloadCollectionAsSomethingChanged = true;
        cmd.getCollectionLock().writeLock().lock();
        
        for(Entry<String, RenameOperation> updateEntry: renOps.entrySet()) {
          String oldKey = updateEntry.getKey();
          
          RenameOperation op = updateEntry.getValue();
          String newKey = op.getNewName();

          JsonWriter jw;
          try {
            jw = new JsonWriter(dbConfig, cmd, collectionName, fileObjectsRef.get().get(collectionName));
          } catch (IOException ioe) {
            logger.error("Failed to obtain writer for " + collectionName, ioe);
            throw new JsonDBException("Failed to save " + collectionName, ioe);
          }
          jw.renameKeyInJsonFile(collection.values(), true, oldKey, newKey);
        }
        cmd.getCollectionLock().writeLock().unlock();
      }
      
      Map<String, AddOperation> addOps = update.getAddOperations();
      if (addOps.size() > 0) {
        reloadCollectionAsSomethingChanged = true;
        cmd.getCollectionLock().writeLock().lock();
        
        for(Entry<String, AddOperation> updateEntry: addOps.entrySet()) {
          AddOperation op = updateEntry.getValue();
          
          Object value = null;
          if (op.isSecret()) {
            value = dbConfig.getCipher().encrypt((String)op.getDefaultValue());
          } else {
            value = op.getDefaultValue();
          }
          
          String fieldName = updateEntry.getKey();
          Method setterMethod = cmd.getSetterMethodForFieldName(fieldName);
          for(T object : collection.values()) {
            Util.setFieldValueForEntity(object, value, setterMethod);
          }
        }
        
        JsonWriter jw;
        try {
          jw = new JsonWriter(dbConfig, cmd, collectionName, fileObjectsRef.get().get(collectionName));
        } catch (IOException ioe) {
          logger.error("Failed to obtain writer for " + collectionName, ioe);
          throw new JsonDBException("Failed to save " + collectionName, ioe);
        }
        jw.reWriteJsonFile(collection.values(), true);
        cmd.getCollectionLock().writeLock().unlock();
      }
      
      Map<String, DeleteOperation> delOps = update.getDeleteOperations();
      if ((renOps.size() < 1 && addOps.size() < 1) && (delOps.size() > 0)) {
        //There were no ADD operations but there are some DELETE operations so we have to just flush the collection once
        //This would not have been necessary if there was even 1 ADD operation
        
        reloadCollectionAsSomethingChanged = true;
        cmd.getCollectionLock().writeLock().lock();
        
        JsonWriter jw;
        try {
          jw = new JsonWriter(dbConfig, cmd, collectionName, fileObjectsRef.get().get(collectionName));
        } catch (IOException ioe) {
          logger.error("Failed to obtain writer for " + collectionName, ioe);
          throw new JsonDBException("Failed to save " + collectionName, ioe);
        }
        jw.reWriteJsonFile(collection.values(), true);
        cmd.getCollectionLock().writeLock().unlock();
      }
      if (reloadCollectionAsSomethingChanged) {
        reloadCollection(collectionName);
      }
    }
  }
394847
public void setConfig(CompilerConfiguration config) {
        if (config == null) throw new NullPointerException("configuration cannot be null");
        this.config = config;
        this.groovyLoader = initGroovyLoader();
    }
148649
public function addCollection(Collection $collection)
    {
        $metadata = $collection->getDocumentMetadata();
        $this->collectionMapping[$metadata->getName()] = $collection;
    }
933438
public void set(SortedSet<? extends Number> collection) {
		this.values = null;
		this.size = 0;

		for (final Number number : collection) {
			final int e = number.intValue();

			if ((this.values != null) && (e == this.values[this.values.length - 1] + 1)) {
				// Same group
				++this.values[this.values.length - 1];
				++this.size;
			}
			if ((this.values != null) && (e > this.values[this.values.length - 1] + 1)) {
				// Create a new group
				final int[] newTab = new int[this.values.length + 2];
				System.arraycopy(this.values, 0, newTab, 0, this.values.length);
				newTab[newTab.length - 2] = e;
				newTab[newTab.length - 1] = newTab[newTab.length - 2];
				this.values = newTab;
				++this.size;
			} else if (this.values == null) {
				// Add the first group
				this.values = new int[] {e, e};
				this.size = 1;
			}

		}
	}
137373
public ChaincodeCollectionConfiguration getChaincodeCollectionConfiguration() throws ProposalException {
        Collection.CollectionConfigPackage collections = parsePayload().getCollections();

        if (null == collections || !parsePayload().hasCollections()) {
            return null;
        }
        try {
            return ChaincodeCollectionConfiguration.fromCollectionConfigPackage(collections);
        } catch (InvalidArgumentException e) {
            throw new ProposalException(e);
        }
    }