コード例 #1
0
 static Dictionary extractModule(
     DefaultsProvider defaults, String encodedPrimalState, String moduleName) {
   if (defaults.getDefaultStateData().found(moduleName)) {
     Dictionary defaultModule = new Dictionary(defaults.getDefaultStateData().subDict(moduleName));
     Dictionary relativeToStateModule =
         extractRelativeToStateModule(encodedPrimalState, defaultModule);
     if (relativeToStateModule != null) {
       defaultModule.merge(relativeToStateModule);
     }
     return defaultModule;
   }
   return null;
 }
コード例 #2
0
 /**
  * Adds environments specified in the "compatible with" attribute to the set of supported
  * environments, along with all defaults from the groups they belong to. Returns these
  * environments, not including the defaults.
  */
 private EnvironmentCollection collectCompatibilityEnvironments(
     EnvironmentCollection.Builder supportedEnvironments) {
   EnvironmentCollection compatibilityEnvironments =
       collectEnvironments(compatibilityAttr, supportedEnvironments);
   for (EnvironmentGroup group : compatibilityEnvironments.getGroups()) {
     supportedEnvironments.putAll(group, defaultsProvider.getDefaults(group));
   }
   return compatibilityEnvironments;
 }