public Person nextPerson ( ) { if ( ! initialized ) { init ( ) ; } Person person = new Person ( ) ; Gender gender = this . gender == null ? ( random . nextBoolean ( ) ? Gender . FEMALE : Gender . MALE ) : this . gender ; person . setGender ( gender ) ; List < String > givenNamesPool = gender == Gender . FEMALE ? givenFemaleNames : givenMaleNames ; List < String > givenNames = new ArrayList < String > ( 2 ) ; givenNames . add ( getNameWord ( givenNamesPool ) ) ; givenNames . add ( getNameWord ( givenNamesPool ) ) ; person . setGivenNames ( givenNames ) ; person . setLastName ( getNameWord ( lastNames ) ) ; generateDOB ( person ) ; Map < String , Object > spewDetails = generateSpewDetails ( person ) ; person . setUsername ( usernameGenerator . nextLine ( spewDetails ) ) ; spewDetails . put ( "USERNAME" , person . getUsername ( ) ) ; person . setEmail ( emailGenerator . nextLine ( spewDetails ) ) ; person . setTwitterUsername ( random . nextInt ( 2 ) == 1 ? "@" + usernameGenerator . nextLine ( spewDetails ) : null ) ; return person ; }
Returns a randomly generated person .