<commit_before>package ca.corefacility.bioinformatics.irida.ria.web.components.agGrid;

import org.apache.commons.text.CaseUtils;

/**
 * Utility functions for the UI Ag Grid.
 */
public class AgGridUtilities {
	private final static String FIND = "\\.";
	private final static String REPLACEMENT = "----";

	/**
	 * Fields should not have periods in them (unless the field is nested inside a JSON object).
	 *
	 * @param headerName {@link String} the header text for the column
	 * @return {@link String}
	 */
	public static String convertHeaderNameToField(String headerName) {
		/*
		Converting to camelcase to help with class attribute in {@link UISampleMetadata},
		most importantly to ensure that createdDate and modifiedDate will match up properly
		with what is store in a metadata template.
		 */
		return CaseUtils.toCamelCase(headerName.replaceAll(FIND, REPLACEMENT), false);
	}
}<commit_msg>Updated comment to make more clear what is going on.<commit_after>package ca.corefacility.bioinformatics.irida.ria.web.components.agGrid;

import org.apache.commons.text.CaseUtils;

/**
 * Utility functions for the UI Ag Grid.
 */
public class AgGridUtilities {
	private final static String FIND = "\\.";
	private final static String REPLACEMENT = "----";

	/**
	 * Fields should not have periods in them (unless the field is nested inside a JSON object).
	 *
	 * @param headerName {@link String} the header text for the column
	 * @return {@link String}
	 */
	public static String convertHeaderNameToField(String headerName) {
		/*
		Fields are attributes on AgGrid column definitions which tells the table which field in the
		row object (UISampleMetadata) to use as the data for that particular column.  By converting
		the header to camel case it facilitate the direct change from the MetadataTemplateField label
		to the field definition for AgGrid.
		E.g. The label "Created Date" will be converted into the field "createdDate" which would match
		with a UISampleMetadata object attribute "createdDate" when serialized to JSON.
		 */
		return CaseUtils.toCamelCase(headerName.replaceAll(FIND, REPLACEMENT), false);
	}
}
{'fraction_non_alphanumeric': 0.08141176470588235, 'fraction_numerical': 0.0, 'mean_word_length': 4.172749391727494, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '7492893', 'n_tokens_mistral': 606, 'n_tokens_neox': 561, 'n_words': 238}