gedcom-api/src/main/java/de/nth/chronicle/gedcom/parser/AddressParser.java

23 lines
828 B
Java

package de.nth.chronicle.gedcom.parser;
import de.nth.chronicle.gedcom.exception.GedcomException;
import de.nth.chronicle.gedcom.type.Address;
public class AddressParser implements RecordParser<Address> {
@Override
public Address parse(RecordChunk chunk) throws GedcomException {
return Address.builder()
.line1(chunk.findFirstValue("ADR1").orElse(null))
.line2(chunk.findFirstValue("ADR2").orElse(null))
.line3(chunk.findFirstValue("ADR3").orElse(null))
.city(chunk.findFirstValue("CITY").orElse(null))
.state(chunk.findFirstValue("STAE").orElse(null))
.postalCode(chunk.findFirstValue("POST").orElse(null))
.country(chunk.findFirstValue("CTRY").orElse(null))
.build();
}
}