<commit_before>package io.bootique.jetty.server;

import java.util.Collections;
import java.util.Map;
import java.util.Set;

/**
 * @since 0.15
 */
public abstract class WebArtifactFactory {

	private Map<String, String> params;
	private Set<String> urlPatterns;

	/**
	 * @param urlPatterns
	 *            a set of URL patterns for the servlet created by this factory.
	 */
	public void setUrlPatterns(Set<String> urlPatterns) {
		this.urlPatterns = urlPatterns;
	}

	public void setParams(Map<String, String> params) {
		this.params = params;
	}

	protected Map<String, String> getParams(Map<String, String> mappedParams) {

		Map<String, String> params = this.params;
		if (params == null || params.isEmpty()) {
			params = mappedParams;
		}

		if (params == null) {
			params = Collections.emptyMap();
		}
		
		return params;
	}<commit_msg>Upgrade to Bootique 0.21: new app metadata package, annotated config help #56<commit_after>package io.bootique.jetty.server;

import io.bootique.annotation.BQConfigProperty;

import java.util.Collections;
import java.util.Map;
import java.util.Set;

/**
 * @since 0.15
 */
public abstract class WebArtifactFactory {

	private Map<String, String> params;
	private Set<String> urlPatterns;

	/**
	 * @param urlPatterns
	 *            a set of URL patterns for the servlet created by this factory.
	 */
	@BQConfigProperty
	public void setUrlPatterns(Set<String> urlPatterns) {
		this.urlPatterns = urlPatterns;
	}

	@BQConfigProperty
	public void setParams(Map<String, String> params) {
		this.params = params;
	}

	protected Map<String, String> getParams(Map<String, String> mappedParams) {

		Map<String, String> params = this.params;
		if (params == null || params.isEmpty()) {
			params = mappedParams;
		}

		if (params == null) {
			params = Collections.emptyMap();
		}
		
		return params;
	}
{'fraction_non_alphanumeric': 0.11528004350190321, 'fraction_numerical': 0.005981511691136488, 'mean_word_length': 3.8806366047745358, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4047443', 'n_tokens_mistral': 633, 'n_tokens_neox': 574, 'n_words': 157}