Skip to content

Commit

Permalink
Issue #83 More conversion of model to Javabeans
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Harrah (frizbog) committed Jul 4, 2016
1 parent cf5771d commit 252e80b
Show file tree
Hide file tree
Showing 20 changed files with 633 additions and 207 deletions.
134 changes: 128 additions & 6 deletions src/main/java/org/gedcom4j/model/Place.java
Expand Up @@ -36,32 +36,32 @@ public class Place extends AbstractElement {
/**
* The place name (value)
*/
public String placeName;
private String placeName;

/**
* The place format (hierarchy)
*/
public StringWithCustomTags placeFormat;
private StringWithCustomTags placeFormat;

/**
* Phonetic variations on the place name. New for GEDCOM 5.5.1.
*/
public List<NameVariation> phonetic = new ArrayList<NameVariation>(0);
private List<NameVariation> phonetic = new ArrayList<NameVariation>(0);

/**
* Romanized variations on the place name. New for GEDCOM 5.5.1.
*/
public List<NameVariation> romanized = new ArrayList<NameVariation>(0);
private List<NameVariation> romanized = new ArrayList<NameVariation>(0);

/**
* Latitude. New for GEDCOM 5.5.1.
*/
public StringWithCustomTags latitude;
private StringWithCustomTags latitude;

/**
* Longitude. New for GEDCOM 5.5.1.
*/
public StringWithCustomTags longitude;
private StringWithCustomTags longitude;

/**
* Notes about this object
Expand Down Expand Up @@ -168,6 +168,24 @@ public List<AbstractCitation> getCitations(boolean initializeIfNeeded) {
return citations;
}

/**
* Get the latitude
*
* @return the latitude
*/
public StringWithCustomTags getLatitude() {
return latitude;
}

/**
* Get the longitude
*
* @return the longitude
*/
public StringWithCustomTags getLongitude() {
return longitude;
}

/**
* Get the notes
*
Expand All @@ -192,6 +210,70 @@ public List<Note> getNotes(boolean initializeIfNeeded) {
return notes;
}

/**
* Get the phonetic
*
* @return the phonetic
*/
public List<NameVariation> getPhonetic() {
return phonetic;
}

/**
* Get the phonetic
*
* @param initializeIfNeeded
* initilize the collection, if needed?
* @return the phonetic
*/
public List<NameVariation> getPhonetic(boolean initializeIfNeeded) {
if (initializeIfNeeded && phonetic == null) {
phonetic = new ArrayList<NameVariation>(0);
}
return phonetic;
}

/**
* Get the placeFormat
*
* @return the placeFormat
*/
public StringWithCustomTags getPlaceFormat() {
return placeFormat;
}

/**
* Get the placeName
*
* @return the placeName
*/
public String getPlaceName() {
return placeName;
}

/**
* Get the romanized
*
* @return the romanized
*/
public List<NameVariation> getRomanized() {
return romanized;
}

/**
* Get the romanized
*
* @param initializeIfNeeded
* initilize the collection, if needed?
* @return the romanized
*/
public List<NameVariation> getRomanized(boolean initializeIfNeeded) {
if (initializeIfNeeded && romanized == null) {
romanized = new ArrayList<NameVariation>(0);
}
return romanized;
}

@Override
public int hashCode() {
final int prime = 31;
Expand All @@ -207,6 +289,46 @@ public int hashCode() {
return result;
}

/**
* Set the latitude
*
* @param latitude
* the latitude to set
*/
public void setLatitude(StringWithCustomTags latitude) {
this.latitude = latitude;
}

/**
* Set the longitude
*
* @param longitude
* the longitude to set
*/
public void setLongitude(StringWithCustomTags longitude) {
this.longitude = longitude;
}

/**
* Set the placeFormat
*
* @param placeFormat
* the placeFormat to set
*/
public void setPlaceFormat(StringWithCustomTags placeFormat) {
this.placeFormat = placeFormat;
}

/**
* Set the placeName
*
* @param placeName
* the placeName to set
*/
public void setPlaceName(String placeName) {
this.placeName = placeName;
}

@Override
public String toString() {
return "Place [" + (placeName != null ? "placeName=" + placeName + ", " : "") + (placeFormat != null ? "placeFormat=" + placeFormat + ", " : "")
Expand Down
63 changes: 60 additions & 3 deletions src/main/java/org/gedcom4j/model/Repository.java
Expand Up @@ -36,17 +36,17 @@ public class Repository extends AbstractElement {
/**
* The name of this repository
*/
public StringWithCustomTags name;
private StringWithCustomTags name;

/**
* The address for this repository
*/
public Address address;
private Address address;

/**
* The change date for this repository
*/
public ChangeDate changeDate;
private ChangeDate changeDate;

/**
* Notes about this object
Expand Down Expand Up @@ -180,6 +180,24 @@ public boolean equals(Object obj) {
return true;
}

/**
* Get the address
*
* @return the address
*/
public Address getAddress() {
return address;
}

/**
* Get the changeDate
*
* @return the changeDate
*/
public ChangeDate getChangeDate() {
return changeDate;
}

/**
* Get the emails
*
Expand Down Expand Up @@ -227,6 +245,15 @@ public List<StringWithCustomTags> getFaxNumbers(boolean initializeIfNeeded) {
return faxNumbers;
}

/**
* Get the name
*
* @return the name
*/
public StringWithCustomTags getName() {
return name;
}

/**
* Get the notes
*
Expand Down Expand Up @@ -356,6 +383,36 @@ public int hashCode() {
return result;
}

/**
* Set the address
*
* @param address
* the address to set
*/
public void setAddress(Address address) {
this.address = address;
}

/**
* Set the changeDate
*
* @param changeDate
* the changeDate to set
*/
public void setChangeDate(ChangeDate changeDate) {
this.changeDate = changeDate;
}

/**
* Set the name
*
* @param name
* the name to set
*/
public void setName(StringWithCustomTags name) {
this.name = name;
}

/**
* Set the recIdNumber
*
Expand Down
46 changes: 44 additions & 2 deletions src/main/java/org/gedcom4j/model/RepositoryCitation.java
Expand Up @@ -38,12 +38,12 @@ public class RepositoryCitation extends AbstractElement {
* The xref of the repository. Kept as a string copy of the xref deliberately to avoid circular references in the
* object graph (particularly, Note -&gt; Citation -&gt; Source -&gt; Repository -&gt; Note -&gt; Citation...)
*/
public String repositoryXref;
private String repositoryXref;

/**
* Call numbers
*/
public List<SourceCallNumber> callNumbers = new ArrayList<SourceCallNumber>(0);
private List<SourceCallNumber> callNumbers = new ArrayList<SourceCallNumber>(0);

/**
* Notes about this object
Expand Down Expand Up @@ -86,6 +86,29 @@ public boolean equals(Object obj) {
return true;
}

/**
* Get the callNumbers
*
* @return the callNumbers
*/
public List<SourceCallNumber> getCallNumbers() {
return callNumbers;
}

/**
* Get the callNumbers
*
* @param initializeIfNeeded
* initialize the collection, if needed?
* @return the callNumbers
*/
public List<SourceCallNumber> getCallNumbers(boolean initializeIfNeeded) {
if (initializeIfNeeded && callNumbers == null) {
callNumbers = new ArrayList<SourceCallNumber>(0);
}
return callNumbers;
}

/**
* Get the notes
*
Expand All @@ -110,6 +133,15 @@ public List<Note> getNotes(boolean initializeIfNeeded) {
return notes;
}

/**
* Get the repositoryXref
*
* @return the repositoryXref
*/
public String getRepositoryXref() {
return repositoryXref;
}

@Override
public int hashCode() {
final int prime = 31;
Expand All @@ -120,6 +152,16 @@ public int hashCode() {
return result;
}

/**
* Set the repositoryXref
*
* @param repositoryXref
* the repositoryXref to set
*/
public void setRepositoryXref(String repositoryXref) {
this.repositoryXref = repositoryXref;
}

@Override
public String toString() {
return "RepositoryCitation [" + (repositoryXref != null ? "repositoryXref=" + repositoryXref + ", " : "") + (notes != null ? "notes=" + notes + ", "
Expand Down

0 comments on commit 252e80b

Please sign in to comment.