-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from aodn/feature/citation-n-constraints#5667
Feature/citation n constraints#5667
- Loading branch information
Showing
10 changed files
with
117 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -432,6 +432,7 @@ | |
"record_suggest": { | ||
"title": "RapidBenthos" | ||
}, | ||
"sci:citation": "{\"suggestedCitation\":null,\"useLimitations\":null,\"otherConstraints\":[\"The data was collected under contract between AIMS and another party(s). Specific agreements for access and use of the data shall be negotiated separately. Contact the AIMS Data Centre ([email protected]) for further information\"]}", | ||
"type": "Collection", | ||
"stac_version": "1.0.0", | ||
"stac_extensions": [ | ||
|
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
42 changes: 42 additions & 0 deletions
42
stacmodel/src/main/java/au/org/aodn/stac/model/Citation.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package au.org.aodn.stac.model; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
@Data | ||
@Builder | ||
@SuppressWarnings("unused") | ||
public class Citation { | ||
|
||
private String suggestedCitation; | ||
private List<String> useLimitations; | ||
private List<String> otherConstraints ; | ||
|
||
public void addUseLimitation(String useLimitation){ | ||
if (this.useLimitations == null) { | ||
this.useLimitations = new ArrayList<>(); | ||
} | ||
this.useLimitations.add(useLimitation); | ||
} | ||
|
||
public void addOtherConstraint(String otherConstraint){ | ||
if (this.otherConstraints == null) { | ||
this.otherConstraints = new ArrayList<>(); | ||
} | ||
this.otherConstraints.add(otherConstraint); | ||
} | ||
|
||
public String toJsonString() { | ||
ObjectMapper mapper = new ObjectMapper(); | ||
try{ | ||
return mapper.writeValueAsString(this); | ||
}catch (JsonProcessingException ignored){ | ||
return null; | ||
} | ||
} | ||
} |
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