<commit_before>/*
 * Copyright (C) 2011-2013 Mojavemvc.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.mojavemvc.core;

import java.math.BigDecimal;
import java.sql.Date;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.mojavemvc.forms.UploadedFile;

/**
 * @author <NAME>
 */
public class SignatureParameters {
    
    private static Map<Class<?>, Parameter> PARAMETER_TYPE_MAP;
    
    static {
        Map<Class<?>, Parameter> map = new HashMap<Class<?>, Parameter>();
        
        /*
         * each of the Parameter instances are stateless, immutable and 
         * thus thread-safe, so the same instance can be shared by multiple threads
         */
        map.put(String.class       ,new StringParameter());
        map.put(String[].class     ,new StringArrayParameter());
        map.put(Integer.class      ,new IntegerParameter());
        map.put(int.class          ,new IntegerParameter());
        map.put(Integer[].class    ,new IntegerArrayParameter());
        map.put(int[].class        ,new PrimitiveIntegerArrayParameter());
        map.put(Long.class         ,new LongParameter());
        map.put(long.class         ,new LongParameter());
        map.put(Long[].class       ,new LongArrayParameter());
        map.put(long[].class       ,new PrimitiveLongArrayParameter());
        map.put(Double.class       ,new DoubleParameter());
        map.put(double.class       ,new DoubleParameter());
        map.put(Double[].class     ,new DoubleArrayParameter());
        map.put(double[].class     ,new PrimitiveDoubleArrayParameter());
        map.put(Date.class         ,new DateParameter());
        map.put(Date[].class       ,new DateArrayParameter());
        map.put(Boolean.class      ,new BooleanParameter());
        map.put(boolean.class      ,new BooleanParameter());
        map.put(Boolean[].class    ,new BooleanArrayParameter());
        map.put(boolean[].class    ,new PrimitiveBooleanArrayParameter());
        map.put(BigDecimal.class   ,new BigDecimalParameter());
        map.put(BigDecimal[].class ,new BigDecimalArrayParameter());<commit_msg>making the parameter type map final<commit_after>/*
 * Copyright (C) 2011-2013 Mojavemvc.org
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.mojavemvc.core;

import java.math.BigDecimal;
import java.sql.Date;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.mojavemvc.forms.UploadedFile;

/**
 * @author <NAME>
 */
public class SignatureParameters {
    
    private static final Map<Class<?>, Parameter> PARAMETER_TYPE_MAP;
    
    static {
        Map<Class<?>, Parameter> map = new HashMap<Class<?>, Parameter>();
        
        /*
         * each of the Parameter instances are stateless, immutable and 
         * thus thread-safe, so the same instance can be shared by multiple threads
         */
        map.put(String.class       ,new StringParameter());
        map.put(String[].class     ,new StringArrayParameter());
        map.put(Integer.class      ,new IntegerParameter());
        map.put(int.class          ,new IntegerParameter());
        map.put(Integer[].class    ,new IntegerArrayParameter());
        map.put(int[].class        ,new PrimitiveIntegerArrayParameter());
        map.put(Long.class         ,new LongParameter());
        map.put(long.class         ,new LongParameter());
        map.put(Long[].class       ,new LongArrayParameter());
        map.put(long[].class       ,new PrimitiveLongArrayParameter());
        map.put(Double.class       ,new DoubleParameter());
        map.put(double.class       ,new DoubleParameter());
        map.put(Double[].class     ,new DoubleArrayParameter());
        map.put(double[].class     ,new PrimitiveDoubleArrayParameter());
        map.put(Date.class         ,new DateParameter());
        map.put(Date[].class       ,new DateArrayParameter());
        map.put(Boolean.class      ,new BooleanParameter());
        map.put(boolean.class      ,new BooleanParameter());
        map.put(Boolean[].class    ,new BooleanArrayParameter());
        map.put(boolean[].class    ,new PrimitiveBooleanArrayParameter());
        map.put(BigDecimal.class   ,new BigDecimalParameter());
        map.put(BigDecimal[].class ,new BigDecimalArrayParameter());
{'fraction_non_alphanumeric': 0.11659858893427405, 'fraction_numerical': 0.004455997029335313, 'mean_word_length': 2.8951554591467823, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1695020', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1418, 'n_words': 411}