<commit_before>package com.mcac0006.siftscience.types;

import org.codehaus.jackson.annotate.JsonValue;
import org.codehaus.jackson.map.annotate.JsonDeserialize;

import com.mcac0006.siftscience.types.deserializer.TransactionTypeDeserializer;


/**
 * The type of transaction being recorded. There are five types.
 * 
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 *
 */
@JsonDeserialize(using=TransactionTypeDeserializer.class)
public enum TransactionType {

	SALE("$sale"),
	AUTHORIZE("$authorize"),
	CAPTURE("$capture"),
	VOID("$void"),
	REFUND("$refund"),
	DEPOSIT("$deposit"),
	WITHDRAWAL("$withdrawal"),
	TRANSFER("$transfer");
	
	private String siftScienceValue;

	private TransactionType(String siftScienceValue) {
		this.siftScienceValue = siftScienceValue;
	}

	@JsonValue
	public String getSiftScienceValue() {
		return siftScienceValue;
	}
	
	public static TransactionType resolve(final String siftScienceValue) {
		
		for (TransactionType type : TransactionType.values()) {
			if (type.getSiftScienceValue().equals(siftScienceValue))
				return type;<commit_msg>Removed duplication as the values can be resolved from the enum values themselves<commit_after>package com.mcac0006.siftscience.types;

import org.codehaus.jackson.annotate.JsonValue;
import org.codehaus.jackson.map.annotate.JsonDeserialize;

import com.mcac0006.siftscience.types.deserializer.TransactionTypeDeserializer;


/**
 * The type of transaction being recorded. There are five types.
 * 
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 * @author <a href="mailto:<EMAIL>"><NAME></a>
 *
 */
@JsonDeserialize(using=TransactionTypeDeserializer.class)
public enum TransactionType {

	SALE,
	AUTHORIZE,
	CAPTURE,
	VOID,
	REFUND,
	DEPOSIT,
	WITHDRAWAL,
	TRANSFER;

	@JsonValue
	public String getSiftScienceValue() {
		return "$" + name().toLowerCase();
	}
	
	public static TransactionType resolve(final String siftScienceValue) {
		
		for (TransactionType type : TransactionType.values()) {
			if (type.getSiftScienceValue().equals(siftScienceValue))
				return type;
{'fraction_non_alphanumeric': 0.12565695174390826, 'fraction_numerical': 0.007644529383659818, 'mean_word_length': 5.798701298701299, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, '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': '2653123', 'n_tokens_mistral': 751, 'n_tokens_neox': 670, 'n_words': 131}