本文整理汇总了Java中io.codearte.jfairy.producer.person.Person类的典型用法代码示例。如果您正苦于以下问题:Java Person类的具体用法?Java Person怎么用?Java Person使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Person类属于io.codearte.jfairy.producer.person包,在下文中一共展示了Person类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: generateUser
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
public static User generateUser(){
Fairy fairy = Fairy.create();
Person person = fairy.person();
BaseProducer baseProducer = fairy.baseProducer();
User user = new User.Builder()
.gender(Gender.MALE)
.username(String.valueOf(baseProducer.randomBetween(1, 999999999)))
.name(person.getFirstName())
.surname(person.getLastName())
.build();
return user;
}
开发者ID:nicolasmanic,项目名称:Facegram,代码行数:13,代码来源:FakeDataGenerator.java
示例2: visit
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
private static void visit(ImmutablePerson parent, int level) {
if (level > MAX_DEPTH) return;
int nextLevel = level + 1;
int siblingCount = level == 1 ? jobTitles[1].length : rnd.nextInt(7) + 2;
for (int i = 0 ; i < siblingCount ; i++) {
Person person = fairy.person();
String jobTitle = level == 1
? jobTitles[1][i]
: randomPick(
jobTitles[level >= jobTitles.length ? jobTitles.length - 1 : level]);
ImmutablePerson p = ImmutablePerson.builder()
.managerEmployeeId(parent.employeeId())
.employeeId(person.getPassportNumber())
.personKind(PersonKind.EMPLOYEE)
.userPrincipalName(person.getUsername())
.title(jobTitle)
.departmentName(randomPick(departmentNames))
.displayName(person.getFullName())
.email((counter++) + person.getEmail())
.build();
peeps.add(p);
visit(p, nextLevel);
}
}
开发者ID:khartec,项目名称:waltz,代码行数:35,代码来源:PersonDataGenerator.java
示例3: get
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
@Override
public NationalIdentificationNumber get() {
if (issueDate == null) {
issueDate = dateProducer.randomDateInThePast(VALIDITY_IN_YEARS);
}
if (sex == null) {
sex = baseProducer.trueOrFalse() ? Person.Sex.MALE : Person.Sex.FEMALE;
}
return new NationalIdentificationNumber(generate());
}
开发者ID:Devskiller,项目名称:jfairy,代码行数:13,代码来源:SvNationalIdentificationNumberProvider.java
示例4: generateUserRequest
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
public static UserRequest generateUserRequest(){
Fairy fairy = Fairy.create();
Person person = fairy.person();
BaseProducer baseProducer = fairy.baseProducer();
return new UserRequest(String.valueOf(baseProducer.randomBetween(1, 999999999)),String.valueOf(baseProducer.randomBetween(1, 999999999)),person.getFirstName(), person.getLastName(), Gender.MALE);
}
开发者ID:nicolasmanic,项目名称:Facegram,代码行数:7,代码来源:FakeDataGenerator.java
示例5: supports
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
@Override
boolean supports(Class<?> targetType) {
return isAssignableFrom(targetType, new Class[]{Person.class});
}
开发者ID:rweisleder,项目名称:jfairy-junit-extension,代码行数:5,代码来源:PersonProvider.java
示例6: german
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
@Test
void german(@Random(locale = "de", seed = 1337) Person person) {
assertThat(person.getFirstName()).isEqualTo("Friedbald");
}
开发者ID:rweisleder,项目名称:jfairy-junit-extension,代码行数:5,代码来源:PersonParameterTests.java
示例7: adult
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
@Test
void adult(@Random @PersonWith(minAge = 18) Person person) {
assertThat(person.getAge()).isGreaterThanOrEqualTo(18);
}
开发者ID:rweisleder,项目名称:jfairy-junit-extension,代码行数:5,代码来源:PersonParameterTests.java
示例8: young
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
@Test
void young(@Random @PersonWith(maxAge = 18) Person person) {
assertThat(person.getAge()).isLessThanOrEqualTo(18);
}
开发者ID:rweisleder,项目名称:jfairy-junit-extension,代码行数:5,代码来源:PersonParameterTests.java
示例9: teenager
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
@Test
void teenager(@Random @PersonWith(minAge = 13, maxAge = 19) Person person) {
assertThat(person.getAge()).isGreaterThanOrEqualTo(13).isLessThanOrEqualTo(19);
}
开发者ID:rweisleder,项目名称:jfairy-junit-extension,代码行数:5,代码来源:PersonParameterTests.java
示例10: flippedAgeParameters
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
@Test
void flippedAgeParameters(@Random @PersonWith(minAge = 18, maxAge = 13) Person person) {
assertThat(person.getAge()).isGreaterThanOrEqualTo(13).isLessThanOrEqualTo(19);
}
开发者ID:rweisleder,项目名称:jfairy-junit-extension,代码行数:5,代码来源:PersonParameterTests.java
示例11: male
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
@Test
void male(@Random @PersonWith(sex = MALE) Person person) {
assertThat(person.getSex()).isEqualTo(MALE);
}
开发者ID:rweisleder,项目名称:jfairy-junit-extension,代码行数:5,代码来源:PersonParameterTests.java
示例12: female
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
@Test
void female(@Random @PersonWith(sex = FEMALE) Person person) {
assertThat(person.getSex()).isEqualTo(FEMALE);
}
开发者ID:rweisleder,项目名称:jfairy-junit-extension,代码行数:5,代码来源:PersonParameterTests.java
示例13: getPerson
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
public Person getPerson() {
return person;
}
开发者ID:hosuaby,项目名称:signature-processing,代码行数:4,代码来源:RandomSignature.java
示例14: setPerson
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
public void setPerson(Person person) {
this.person = person;
}
开发者ID:hosuaby,项目名称:signature-processing,代码行数:4,代码来源:RandomSignature.java
示例15: setSex
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
public void setSex(Person.Sex sex) {
this.sex = sex;
}
开发者ID:Devskiller,项目名称:jfairy,代码行数:4,代码来源:SvNationalIdentificationNumberProvider.java
示例16: calculateSexCode
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
private int calculateSexCode(Person.Sex sex) {
return SEX_FIELDS[baseProducer.randomInt(SEX_FIELDS.length - 1)] + (sex == Person.Sex.MALE ? 1 : 0);
}
开发者ID:Devskiller,项目名称:jfairy,代码行数:4,代码来源:SvNationalIdentificationNumberProvider.java
示例17: main
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
public static void main(String[] args) {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
PersonService personService = ctx.getBean(PersonService.class);
PersonHierarchyService personHierarchyService = ctx.getBean(PersonHierarchyService.class);
Person person = fairy.person();
ImmutablePerson root = ImmutablePerson.builder()
.employeeId(person.getPassportNumber())
.personKind(PersonKind.EMPLOYEE)
.userPrincipalName(person.getUsername())
.title(randomPick(jobTitles[0]))
.departmentName("CEO")
.displayName(person.getFullName())
.email(person.getEmail())
.build();
peeps.add(root);
visit(root, 1);
System.out.println(peeps.size());
personService.bulkSave(peeps);
personHierarchyService.build();
}
开发者ID:khartec,项目名称:waltz,代码行数:33,代码来源:PersonDataGenerator.java
示例18: person
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
/**
* Use this method for fake persons
*
* @param personProperties desired person features
* @return A {@link io.codearte.jfairy.producer.person.Person} instance
*/
public Person person(PersonProperties.PersonProperty... personProperties) {
return personFactory.producePersonProvider(personProperties).get();
}
开发者ID:Devskiller,项目名称:jfairy,代码行数:10,代码来源:Fairy.java
示例19: set
import io.codearte.jfairy.producer.person.Person; //导入依赖的package包/类
void set(Struct struct, Person person);
开发者ID:jcustenborder,项目名称:kafka-connect-simulator,代码行数:2,代码来源:StructSetter.java
注:本文中的io.codearte.jfairy.producer.person.Person类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论