-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add builders to geo location classes
- Loading branch information
Showing
7 changed files
with
155 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
...el/src/main/java/de/digitalcollections/model/identifiable/entity/geo/location/Canyon.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,94 @@ | ||
package de.digitalcollections.model.identifiable.entity.geo.location; | ||
|
||
import lombok.experimental.SuperBuilder; | ||
|
||
/** | ||
* A deep ravine between cliffs. see https://www.wikidata.org/wiki/Q150784 "Schlucht; tief | ||
* eingeschnittenes Tal" | ||
*/ | ||
@SuperBuilder(buildMethodName = "prebuild") | ||
public class Canyon extends GeoLocation { | ||
|
||
public abstract static class CanyonBuilder<C extends Canyon, B extends CanyonBuilder<C, B>> | ||
extends GeoLocationBuilder<C, B> { | ||
|
||
@Override | ||
public C build() { | ||
C c = prebuild(); | ||
c.init(); | ||
setInternalReferences(c); | ||
return c; | ||
} | ||
} | ||
|
||
public Canyon() { | ||
super(); | ||
init(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) return true; | ||
if (!super.equals(obj)) return false; | ||
if (getClass() != obj.getClass()) return false; | ||
return true; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return super.hashCode(); | ||
} | ||
|
||
@Override | ||
protected void init() { | ||
super.init(); | ||
this.geoLocationType = GeoLocationType.CANYON; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Canyon [coordinateLocation=" | ||
+ coordinateLocation | ||
+ ", geoLocationType=" | ||
+ geoLocationType | ||
+ ", name=" | ||
+ name | ||
+ ", nameLocalesOfOriginalScripts=" | ||
+ nameLocalesOfOriginalScripts | ||
+ ", customAttributes=" | ||
+ customAttributes | ||
+ ", navDate=" | ||
+ navDate | ||
+ ", refId=" | ||
+ refId | ||
+ ", notes=" | ||
+ notes | ||
+ ", description=" | ||
+ description | ||
+ ", identifiableObjectType=" | ||
+ identifiableObjectType | ||
+ ", identifiers=" | ||
+ identifiers | ||
+ ", label=" | ||
+ label | ||
+ ", localizedUrlAliases=" | ||
+ localizedUrlAliases | ||
+ ", previewImage=" | ||
+ previewImage | ||
+ ", previewImageRenderingHints=" | ||
+ previewImageRenderingHints | ||
+ ", subjects=" | ||
+ subjects | ||
+ ", tags=" | ||
+ tags | ||
+ ", type=" | ||
+ type | ||
+ ", created=" | ||
+ created | ||
+ ", lastModified=" | ||
+ lastModified | ||
+ ", uuid=" | ||
+ uuid | ||
+ "]"; | ||
} | ||
} |
75 changes: 75 additions & 0 deletions
75
...odel/src/main/java/de/digitalcollections/model/identifiable/entity/geo/location/Cave.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,94 @@ | ||
package de.digitalcollections.model.identifiable.entity.geo.location; | ||
|
||
import lombok.experimental.SuperBuilder; | ||
|
||
/** | ||
* A natural underground space large enough for a human to enter. see | ||
* https://www.wikidata.org/wiki/Q35509 "Höhle; natürlich entstandener unterirdischer Hohlraum" | ||
*/ | ||
@SuperBuilder(buildMethodName = "prebuild") | ||
public class Cave extends GeoLocation { | ||
|
||
public abstract static class CaveBuilder<C extends Cave, B extends CaveBuilder<C, B>> | ||
extends GeoLocationBuilder<C, B> { | ||
|
||
@Override | ||
public C build() { | ||
C c = prebuild(); | ||
c.init(); | ||
setInternalReferences(c); | ||
return c; | ||
} | ||
} | ||
|
||
public Cave() { | ||
super(); | ||
init(); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object obj) { | ||
if (this == obj) return true; | ||
if (!super.equals(obj)) return false; | ||
if (getClass() != obj.getClass()) return false; | ||
return true; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return super.hashCode(); | ||
} | ||
|
||
@Override | ||
protected void init() { | ||
super.init(); | ||
this.geoLocationType = GeoLocationType.CAVE; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Cave [coordinateLocation=" | ||
+ coordinateLocation | ||
+ ", geoLocationType=" | ||
+ geoLocationType | ||
+ ", name=" | ||
+ name | ||
+ ", nameLocalesOfOriginalScripts=" | ||
+ nameLocalesOfOriginalScripts | ||
+ ", customAttributes=" | ||
+ customAttributes | ||
+ ", navDate=" | ||
+ navDate | ||
+ ", refId=" | ||
+ refId | ||
+ ", notes=" | ||
+ notes | ||
+ ", description=" | ||
+ description | ||
+ ", identifiableObjectType=" | ||
+ identifiableObjectType | ||
+ ", identifiers=" | ||
+ identifiers | ||
+ ", label=" | ||
+ label | ||
+ ", localizedUrlAliases=" | ||
+ localizedUrlAliases | ||
+ ", previewImage=" | ||
+ previewImage | ||
+ ", previewImageRenderingHints=" | ||
+ previewImageRenderingHints | ||
+ ", subjects=" | ||
+ subjects | ||
+ ", tags=" | ||
+ tags | ||
+ ", type=" | ||
+ type | ||
+ ", created=" | ||
+ created | ||
+ ", lastModified=" | ||
+ lastModified | ||
+ ", uuid=" | ||
+ uuid | ||
+ "]"; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters