A container class for saving parameters

xiaoxiao2021-03-06  20

Import java.util. *;

/ ** * Provides a container for saving parameters, providing parameter read capabilities for those with more parameters, optional parameters, and parameter variable. * Direct use of MAP and other classes are not convenient for data type. This class provides a read method for common data types. Method:
* port = args.get ("port", 8080);
* Put value placed in MAP can be "8443" or new integer (8443) or any other type, as long as totring ) * Ability to resolve an integer. * @Author sunlen * @version 1.0 * / public class args {

/ ** A constant empty parameter table. Used to pass empty parameters, the parameter list has been locked and cannot be modified. * / Public static final args Empty = new args (). LOCK ();

/ ** The parameter list has been locked, and the list after the lock will read. * / Boolean Locked;

/ ** Map saved parameters. * / Map args;

/ ** Create a list of empty parameters. * / Public args () {

This (new hashmap ());

/ ** * Create a parameter with MAP. * @Param THEARGS Saves the MAP object of the parameter. * / Public args (map theargs) {

IF (THEARGS == NULL) {

Ayuan

9CBS certified blog expert

Blog expert

Huawei old employees

Big Data

More than ten years, in Huawei, Internet Corporation's experience, profound understanding and practical experience in CRM, big data, mainly sharing various project experience, including architecture, Java, big data and other articles

转载请注明原文地址:https://www.9cbs.com/read-44806.html

New Post(0)