use of com.github.javafaker.Book in project com-liferay-apio-architect by liferay.
the class BlogPostingModel method compute.
/**
* Computes the fake data for this model class.
*/
public static void compute() {
if (!_blogPostings.isEmpty()) {
return;
}
for (long index = 0; index < 42; index++) {
Faker faker = new Faker();
Book book = faker.book();
Lorem lorem = faker.lorem();
RandomService randomService = faker.random();
int creatorId = randomService.nextInt(PersonModel.getCount());
DateAndTime dateAndTime = faker.date();
Date date = dateAndTime.past(400, DAYS);
BlogPostingModel blogPostingModel = new BlogPostingModel(_count.get(), lorem.paragraph(), date, creatorId, date, lorem.sentence(), book.title());
_blogPostings.put(_count.getAndIncrement(), blogPostingModel);
}
}
Aggregations