All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.qa.framework.library.pmd.PMDHelper Maven / Gradle / Ivy

There is a newer version: 3.8
Show newest version
/*
 * Copyright 2011 State Street Corporation. All rights reserved.
 */
package com.qa.framework.library.pmd;

import java.math.BigDecimal;
import java.util.*;

/**
 * Utility methods for walking around particular known PMD violations.
 */
public class PMDHelper {
    /**
     * Bypasses the violation of "new" instance in a loop.
     *
     * @return new {@code List>} instance
     */
    public static List> newSheetData() {
        return new ArrayList>();
    }

    /**
     * Bypasses the violation of "new" instance in a loop.
     *
     * @return new {@code Map} instance
     */
    public static Map newRowData() {
        return new LinkedHashMap();
    }

    /**
     * Bypasses the violation of "new" instance in a loop.
     *
     * @param value the value
     * @return new {@code BigDecimal} instance
     */
    public static BigDecimal newBigDecimal(final String value) {
        return new BigDecimal(value);
    }

    /**
     * Bypasses the violation of "new" instance in a loop.
     *
     * @return new {@code Map} instance
     */
    public static Map newJbmpParam() {
        return new HashMap();
    }

    /**
     * Uses to avoid PMD violation
     *
     * @return {@link LinkedHashMap}
     */
    public static LinkedHashMap newLinkedHashMap() {
        return new LinkedHashMap();
    }

    /**
     * Uses to avoid PMD violation
     *
     * @return the map
     */
    public static Map newMapObj() {
        return new HashMap();
    }

    /**
     * Uses to avoid PMD violation
     *
     * @return the map
     */
    public static Map newHashMap() {
        return new HashMap();
    }

    /**
     * Uses to avoid PMD violation
     *
     * @return the map
     */
    public static Map newIntStrMap() {
        return new HashMap();
    }

    /**
     * Uses to avoid PMD violation
     *
     * @param bytes the bytes
     * @return the string
     */
    public static String newString(byte[] bytes) {
        return new String(bytes);
    }

    /**
     * Uses to avoid PMD violation
     *
     * @return the list
     */
    public static List newStringList() {
        return new ArrayList();
    }

    /**
     * Uses to avoid PMD violation
     *
     * @return the linked list
     */
    public static LinkedList newLinkedStringList() {
        return new LinkedList();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy