<commit_before>package io.vertigo.x.audit;


import java.util.Date;
import java.util.List;

import io.vertigo.lang.Assertion;
import io.vertigo.lang.Builder;

/**
 * Builder for an audit trace
 * @author xdurand
 *
 */
public class AuditTraceBuilder implements Builder<AuditTrace> {

	private Long id;
	private final String category;
	private final String user;
	private Date businessDate;
	private final Date executionDate;
	private final Long item;
	private final String message;
	private String context;

	/**
	 * Builder for AuditTrace
	 * @param id
	 * @param category
	 * @param user
	 * @param item
	 */
	AuditTraceBuilder(final String category, final String user, final Long item, final String message) {
		Assertion.checkNotNull(item);
		Assertion.checkArgNotEmpty(category);
		Assertion.checkArgNotEmpty(user);
		//---
		this.category = category;
		this.user = user;
		this.message = message;
		this.item = item;
		this.executionDate = new Date();
	}

	/**
	 * Optionnal business date
	 * @param dateBusiness
	 * @return the builder (for fluent style)
	 */
	public AuditTraceBuilder withDateBusiness(final Date dateBusiness) {
		Assertion.checkNotNull(dateBusiness);
		//---
		this.businessDate = dateBusiness;
		return this;
	}

	/**
	 * Optionnal business date
	 * @param context context for metadata
	 * @param dateBusiness
	 * @return the builder (for fluent style)
	 */
	public AuditTraceBuilder withContext(final List<String> context) {
		Assertion.checkNotNull(context);
		Assertion.checkArgument(context.isEmpty() == false, "The provided context is empty");
		//---
		final StringBuilder sb = new StringBuilder();
		for (final String string : context) {
			sb.append(string).append("|");
		}
		this.context = sb.toString();
		return this;
	}

	@Override
	public AuditTrace build() {
		return new AuditTrace(this.id, this.category, this.user, this.businessDate, this.executionDate, this.item, this.message, this.context);
	}

}<commit_msg>fixed warns<commit_after>package io.vertigo.x.audit;

import java.util.Date;
import java.util.List;

import io.vertigo.lang.Assertion;
import io.vertigo.lang.Builder;

/**
 * Builder for an audit trace
 * @author xdurand
 *
 */
public class AuditTraceBuilder implements Builder<AuditTrace> {

	private Long id;
	private final String category;
	private final String user;
	private Date businessDate;
	private final Date executionDate;
	private final Long item;
	private final String message;
	private String myContext;

	/**
	 * Builder for AuditTrace
	 * @param id
	 * @param category
	 * @param user
	 * @param item
	 */
	AuditTraceBuilder(final String category, final String user, final Long item, final String message) {
		Assertion.checkNotNull(item);
		Assertion.checkArgNotEmpty(category);
		Assertion.checkArgNotEmpty(user);
		//---
		this.category = category;
		this.user = user;
		this.message = message;
		this.item = item;
		executionDate = new Date();
	}

	/**
	 * Optionnal business date
	 * @param dateBusiness
	 * @return the builder (for fluent style)
	 */
	public AuditTraceBuilder withDateBusiness(final Date dateBusiness) {
		Assertion.checkNotNull(dateBusiness);
		//---
		businessDate = dateBusiness;
		return this;
	}

	/**
	 * Optionnal business date
	 * @param context context for metadata
	 * @return the builder (for fluent style)
	 */
	public AuditTraceBuilder withContext(final List<String> context) {
		Assertion.checkNotNull(context);
		Assertion.checkArgument(context.isEmpty() == false, "The provided context is empty");
		//---
		final StringBuilder sb = new StringBuilder();
		for (final String string : context) {
			sb.append(string).append("|");
		}
		this.myContext = sb.toString();
		return this;
	}

	@Override
	public AuditTrace build() {
		return new AuditTrace(id, category, user, businessDate, executionDate, item, message, myContext);
	}

}
{'fraction_non_alphanumeric': 0.10934652434261911, 'fraction_numerical': 0.0, 'mean_word_length': 4.068601583113456, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '5453245', 'n_tokens_mistral': 1232, 'n_tokens_neox': 1127, 'n_words': 333}