use of hex.glm.GLM2.Source in project ORCID-Source by ORCID.
the class OtherNameForm method toOtherName.
public OtherName toOtherName() {
OtherName otherName = new OtherName();
if (!PojoUtil.isEmpty(this.getContent())) {
otherName.setContent(this.getContent());
}
if (this.visibility != null && this.visibility.getVisibility() != null) {
otherName.setVisibility(org.orcid.jaxb.model.common_v2.Visibility.fromValue(this.getVisibility().getVisibility().value()));
}
if (!PojoUtil.isEmpty(this.getPutCode())) {
otherName.setPutCode(Long.valueOf(this.getPutCode()));
}
if (displayIndex != null) {
otherName.setDisplayIndex(displayIndex);
} else {
otherName.setDisplayIndex(0L);
}
otherName.setSource(new Source(source));
return otherName;
}
use of hex.glm.GLM2.Source in project ORCID-Source by ORCID.
the class JpaJaxbNameAdapterTest method fromNameToRecordNameEntityTest.
@Test
public void fromNameToRecordNameEntityTest() throws JAXBException {
Name name = new Name();
name.setCreditName(new CreditName("Credit Name"));
name.setFamilyName(new FamilyName("Family Name"));
name.setGivenNames(new GivenNames("Given Names"));
name.setPath("0000-0000-0000-0000");
name.setVisibility(Visibility.PUBLIC);
name.setSource(new Source("0000-0000-0000-0000"));
RecordNameEntity entity = adapter.toRecordNameEntity(name);
assertNotNull(entity);
assertEquals("Credit Name", entity.getCreditName());
assertEquals("Family Name", entity.getFamilyName());
assertEquals("Given Names", entity.getGivenNames());
assertEquals(Visibility.PUBLIC, entity.getVisibility());
assertNotNull(entity.getProfile());
assertEquals("0000-0000-0000-0000", entity.getProfile().getId());
}
Aggregations