com.github.javafaker.Superhero Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of javafaker Show documentation
Show all versions of javafaker Show documentation
This library is a port of Ruby's stympy/faker gem (as well as Perl's Data::Faker library) that generates fake data.
It's useful when you're developing a new project and need some pretty data for showcase.
package com.github.javafaker;
import com.github.javafaker.service.FakeValuesServiceInterface;
public class Superhero {
private final Resolver resolver;
private final FakeValuesServiceInterface fakeValueService;
public Superhero(Resolver resolver,
FakeValuesServiceInterface fakeValueService) {
this.resolver = resolver;
this.fakeValueService = fakeValueService;
}
public String name() {
return fakeValueService.resolve("superhero.name", this, resolver);
}
public String prefix() {
return fakeValueService.fetchString("superhero.prefix");
}
public String suffix() {
return fakeValueService.fetchString("superhero.suffix");
}
public String power() {
return fakeValueService.fetchString("superhero.power");
}
public String descriptor() {
return fakeValueService.fetchString("superhero.descriptor");
}
}