Java random 32-bit long string

Source: Internet
Author: User

Commonutils class-dependent jar packages: Commons-beanutils.jar, Commons-logging.jaruuid () methods           *  returns a random 32-bit long string          *  use:          * can be used to do a variety of ID and other variables can not be repeated, the database table in the primary key can not be repeated, it is not repeated!     @Test         public void testunid ()          {             String s=commonutils.uuid ();             System.out.println (s);         } role: Encapsulate data from a map into JavaBean           *  Requirements:          *  1. Requires that the key name in map is the same as the property name in JavaBean, and is lost if the attribute name is not in JavaBean. If there is sex in the map, and JavaBean does not have sex,javabean in the sex is empty            @Test         public void testtobean ()//need to have a corresponding Javabean{id,name,age + set , get, tostring method}        {         /**         * 1. Creating map          */        map<string,object> map= New hashmap<string,object> ();         map.put ("id",  " 001 ");         map.put (" Name "," Zouzou ");         map.put ("Age",  21);//If the following 21 is a "21" string, it will be self-type converted          map.put ("xxx", "xxx");//Data Loss example, JavaBean no XXX attribute           person p=commonutils.tobean (Map, person.class);        &NBSP;SYSTEM.OUT.PRINTLN (p);         } 

Java random 32-bit long string

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.