com.github.javafaker.Color 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;
public class Color {
private final Faker faker;
protected Color(Faker faker) {
this.faker = faker;
}
public String name() {
return faker.fakeValuesService().resolve("color.name", this, faker);
}
public String hex() {
return hex(true);
}
public String hex(boolean includeHashSign) {
String hexString = faker.random().hex(6);
if(includeHashSign)
return "#" + hexString;
return hexString;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy