Adds model substitution rules (alternateTypeRules)

@param alternateTypeRules - rules to be applied
@return this Docket
@see springfox.documentation.schema.AlternateTypeRules#newRule(java.lang.reflect.Type,
java.lang.reflect.Type)
336710
public Docket alternateTypeRules(AlternateTypeRule... alternateTypeRules) {
    this.ruleBuilders.addAll(Stream.of(alternateTypeRules).map(identityRuleBuilder()).collect(toList()));
    return this;
  }
106776
private static void addPluralRules(TypeSpec.Builder type) {
    FieldSpec field = FieldSpec.builder(PLURAL_RULES, "pluralRules", PRIVATE, STATIC, FINAL)
        .initializer("new $T()", PLURAL_RULES)
        .build();
    
    MethodSpec method = MethodSpec.methodBuilder("getPluralRules")
        .addModifiers(PUBLIC)
        .returns(PLURAL_RULES)
        .addStatement("return pluralRules")
        .build();

    type.addField(field);
    type.addMethod(method);
  }
351863
public void setRules(Map<String, ReplicationRule> rules) {
        if (rules == null) {
            throw new IllegalArgumentException(
                    "Replication rules cannot be null");
        }
        this.rules = new HashMap<String, ReplicationRule>(rules);
    }
132030
public ResolvedType alternateFor(ResolvedType type) {
    if (appliesTo(type)) {
      if (hasWildcards(original)) {
        return replaceWildcardsFrom(WildcardType.collectReplaceables(type, original), alternate);
      } else {
        return alternate;
      }
    }
    return type;
  }
407198
public static <V> void swapVertices(DirectedGraph<V, DefaultEdge> graph, Map<V, Set<V>> alternates) {
        Objects.requireNonNull(graph,"graph");
        Objects.requireNonNull(alternates, "alternates");
        // add all of the new vertices to prep for linking
        addAllVertices(graph, alternates.keySet());

        for (Entry<V, Set<V>> entry : alternates.entrySet()) {
            V alternateVertex = entry.getKey();
            Set<V> dependencies = entry.getValue();
            // make sure we can satisfy all dependencies before continuing
            // TODO: this should probably done outside so it can be handled better.
            if (!graph.vertexSet().containsAll(dependencies)) {
                continue;
            }

            // figure out which vertices depend on the incumbent vertex
            Set<V> dependents = Collections.emptySet();
            if (graph.containsVertex(alternateVertex)) {
                dependents = getIncomingVertices(graph, alternateVertex);
                graph.removeVertex(alternateVertex);
            }
            // (re)insert the vertex and re-link the dependents
            graph.addVertex(alternateVertex);
            addIncomingEdges(graph, alternateVertex, dependents);

            // create the dependencies
            addOutgoingEdges(graph, alternateVertex, dependencies);
        }
    }
132106
public MultipleRuleContext<DPO, RI, RO> check(Collection<Rule<RI, RO>> rules) {
        if (rules != null) {
            addedRules.addAll(rules);
        }

        // Stay in the same context and re-use the same instance because no type has changed
        return this;
    }
1215611
public final EObject entryRuleTypeReferenceNoTypeArgs() throws RecognitionException {
        EObject current = null;

        EObject iv_ruleTypeReferenceNoTypeArgs = null;


        try {
            // InternalSARL.g:9189:64: (iv_ruleTypeReferenceNoTypeArgs= ruleTypeReferenceNoTypeArgs EOF )
            // InternalSARL.g:9190:2: iv_ruleTypeReferenceNoTypeArgs= ruleTypeReferenceNoTypeArgs EOF
            {
            if ( state.backtracking==0 ) {
               newCompositeNode(grammarAccess.getTypeReferenceNoTypeArgsRule()); 
            }
            pushFollow(FOLLOW_1);
            iv_ruleTypeReferenceNoTypeArgs=ruleTypeReferenceNoTypeArgs();

            state._fsp--;
            if (state.failed) return current;
            if ( state.backtracking==0 ) {
               current =iv_ruleTypeReferenceNoTypeArgs; 
            }
            match(input,EOF,FOLLOW_2); if (state.failed) return current;

            }

        }

            catch (RecognitionException re) {
                recover(input,re);
                appendSkippedTokens();
            }
        finally {
        }
        return current;
    }
1087006
public void setCustomRules(java.util.Collection<CustomRule> customRules) {
        if (customRules == null) {
            this.customRules = null;
            return;
        }

        this.customRules = new java.util.ArrayList<CustomRule>(customRules);
    }
1123989
@Nonnull
  public AbstractHasTopLevelRules addRule (@Nonnull final ICSSTopLevelRule aRule)
  {
    ValueEnforcer.notNull (aRule, "Rule");

    m_aRules.add (aRule);
    return this;
  }
496371
function modifyOutRule(rule, type) {
	rule.test = new RegExp(
		'\\.(' + Config.out[type].extensions.join('|') + ')$'
	);
}
292727
public void setRulesPackages(java.util.Collection<RulesPackage> rulesPackages) {
        if (rulesPackages == null) {
            this.rulesPackages = null;
            return;
        }

        this.rulesPackages = new java.util.ArrayList<RulesPackage>(rulesPackages);
    }
464176
public static com.liferay.commerce.discount.model.CommerceDiscountRule addCommerceDiscountRule(
		com.liferay.commerce.discount.model.CommerceDiscountRule commerceDiscountRule) {
		return getService().addCommerceDiscountRule(commerceDiscountRule);
	}
549335
public AlternateOf newAlternateOf(QualifiedName entity1, QualifiedName entity2) {
	AlternateOf res = of.createAlternateOf();
	res.setAlternate1(entity1);
	res.setAlternate2(entity2);
	return res;
    }
482753
private int addRuleContainer(SpatialRuleContainer container) {
        int newIndex = this.ruleContainers.indexOf(container);
        if (newIndex >= 0)
            return newIndex;

        newIndex = ruleContainers.size();
        if (newIndex >= 255)
            throw new IllegalStateException("No more spatial rule container fit into this lookup as 255 combination of ruleContainers reached");

        this.ruleContainers.add(container);
        return newIndex;
    }
1267978
public void addBeanRule(final BeanRule beanRule) throws IllegalRuleException {
        PrefixSuffixPattern prefixSuffixPattern = PrefixSuffixPattern.parse(beanRule.getId());
        String scanPattern = beanRule.getScanPattern();
        if (scanPattern != null) {
            BeanClassScanner scanner = createBeanClassScanner(beanRule);
            List<BeanRule> beanRules = new ArrayList<>();
            scanner.scan(scanPattern, (resourceName, targetClass) -> {
                BeanRule beanRule2 = beanRule.replicate();
                if (prefixSuffixPattern != null) {
                    beanRule2.setId(prefixSuffixPattern.join(resourceName));
                } else {
                    if (beanRule.getId() != null) {
                        beanRule2.setId(beanRule.getId() + resourceName);
                    } else if (beanRule.getMaskPattern() != null) {
                        beanRule2.setId(resourceName);
                    }
                }
                beanRule2.setBeanClass(targetClass);
                beanRules.add(beanRule2);
            });
            for (BeanRule beanRule2 : beanRules) {
                dissectBeanRule(beanRule2);
            }
        } else {
            if (!beanRule.isFactoryOffered()) {
                String className = beanRule.getClassName();
                if (prefixSuffixPattern != null) {
                    beanRule.setId(prefixSuffixPattern.join(className));
                }
                Class<?> beanClass;
                try {
                    beanClass = classLoader.loadClass(className);
                } catch (ClassNotFoundException e) {
                    throw new BeanRuleException("Failed to load bean class", beanRule, e);
                }
                beanRule.setBeanClass(beanClass);
            }
            dissectBeanRule(beanRule);
        }
    }
127533
public static void substituteMark( Rule rule, String wellKnownMarkName ) {
        PointSymbolizer pointSymbolizer = StyleUtilities.pointSymbolizerFromRule(rule);
        Mark oldMark = SLD.mark(pointSymbolizer);

        Graphic graphic = SLD.graphic(pointSymbolizer);
        graphic.graphicalSymbols().clear();

        Mark mark = StyleUtilities.sf.createMark();
        mark.setWellKnownName(StyleUtilities.ff.literal(wellKnownMarkName));
        if (oldMark != null) {
            mark.setFill(oldMark.getFill());
            mark.setStroke(oldMark.getStroke());
        }
        graphic.graphicalSymbols().add(mark);
    }
1007658
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CPRule addCPRule(CPRule cpRule) {
		cpRule.setNew(true);

		return cpRulePersistence.update(cpRule);
	}