<commit_before>package br.com.dbsoft.util;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Date;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
import java.util.Locale;

public class DBSFormat {
	
	public class MASK{
		public static final String QUANTIDADE_INTEIRA = "###,##0";
		public static final String FINANCEIRO = "###,##0.00";
	}
	
	public static enum NUMBER_SIGN{
		NONE,
		CRDB_PREFIX,
		CRDB_SUFFIX,
		MINUS_SUFFIX,
		MINUS_PREFIX,
		PARENTHESES;
	}
	
	//######################################################################################################### 
	//## public properties                                                                                        #
	//#########################################################################################################

	/**
	 * Retorna string contendo a data reduzida formatada no padrão dd/mm/yyyy
	 * @param pData Data a ser formatado
	 * @return String com a data já formatada
	 */
	public static String getFormattedDate(Object pDate){
		if (DBSObject.isEmpty(pDate)){
			return "";
		}else{
			SimpleDateFormat xFormat = new SimpleDateFormat("dd/MM/yyyy");
			return xFormat.format(DBSDate.toDate(pDate));
		}
	}
	
	/**
	 * Retorna string contendo a data reduzida formatada no padrão dd/mm/yyyy
	 * @param pData Data a ser formatado
	 * @return String com a data já formatada<commit_msg>Método para formatar data a partir de long<commit_after>package br.com.dbsoft.util;

import java.math.BigDecimal;
import java.math.RoundingMode;
import java.sql.Date;
import java.sql.Timestamp;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.SimpleDateFormat;
import java.util.Locale;

public class DBSFormat {
	
	public class MASK{
		public static final String QUANTIDADE_INTEIRA = "###,##0";
		public static final String FINANCEIRO = "###,##0.00";
	}
	
	public static enum NUMBER_SIGN{
		NONE,
		CRDB_PREFIX,
		CRDB_SUFFIX,
		MINUS_SUFFIX,
		MINUS_PREFIX,
		PARENTHESES;
	}
	
	//######################################################################################################### 
	//## public properties                                                                                        #
	//#########################################################################################################

	/**
	 * Retorna string contendo a data reduzida formatada no padrão dd/mm/yyyy
	 * @param pData Data a ser formatado
	 * @return String com a data já formatada
	 */
	public static String getFormattedDate(Long pDate){
		return getFormattedDate(DBSDate.toDate(pDate));
	}
	
	public static String getFormattedDate(Object pDate){
		if (DBSObject.isEmpty(pDate)){
			return "";
		}else{
			SimpleDateFormat xFormat = new SimpleDateFormat("dd/MM/yyyy");
			return xFormat.format(DBSDate.toDate(pDate));
		}
	}
	
	/**
	 * Retorna string contendo a data reduzida formatada no padrão dd/mm/yyyy
	 * @param pData Data a ser formatado
	 * @return String com a data já formatada
{'fraction_non_alphanumeric': 0.21935483870967742, 'fraction_numerical': 0.0025806451612903226, 'mean_word_length': 3.6352765321375187, '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': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3863162', 'n_tokens_mistral': 965, 'n_tokens_neox': 863, 'n_words': 231}