Skip to content

Commit

Permalink
Merge pull request #220 from Breeding-Insight/develop
Browse files Browse the repository at this point in the history
Merge for release 0.9
  • Loading branch information
nickpalladino authored Apr 10, 2024
2 parents c224ba3 + c0c585d commit 42211ab
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@

package org.brapi.client.v2.modules.germplasm;

import com.google.gson.JsonObject;

import org.apache.commons.lang3.tuple.Pair;
import org.brapi.client.v2.ApiResponse;
import org.brapi.client.v2.BrAPIClientTest;
Expand Down Expand Up @@ -109,8 +111,8 @@ public void searchPedigreeGetResponse() throws Exception {
@Test
public void createPedigreeSuccess() throws Exception {

Map<String, String> additionalInfo = new HashMap<String, String>();
additionalInfo.put("test_key", "test_value");
JsonObject additionalInfo = new JsonObject();
additionalInfo.addProperty("test_key", "test_value");
List<BrAPIExternalReference> externalReferences = new ArrayList<>();
externalReferences.add(new BrAPIExternalReference()
.referenceID(UUID.randomUUID().toString())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import java.util.Map;
import java.util.Objects;

import com.google.gson.JsonObject;
import org.brapi.v2.model.BrAPIExternalReference;

import com.fasterxml.jackson.annotation.JsonProperty;
Expand All @@ -28,7 +29,7 @@

public class BrAPIPedigreeNode {
@JsonProperty("additionalInfo")
private Map<String, String> additionalInfo = null;
private JsonObject additionalInfo = null;

@JsonProperty("breedingMethodDbId")
private String breedingMethodDbId = null;
Expand Down Expand Up @@ -76,16 +77,16 @@ public class BrAPIPedigreeNode {
@JsonProperty("siblings")
private List<BrAPIPedigreeNodeSibling> siblings = null;

public BrAPIPedigreeNode additionalInfo(Map<String, String> additionalInfo) {
public BrAPIPedigreeNode additionalInfo(JsonObject additionalInfo) {
this.additionalInfo = additionalInfo;
return this;
}

public BrAPIPedigreeNode putAdditionalInfoItem(String key, String additionalInfoItem) {
if (this.additionalInfo == null) {
this.additionalInfo = new HashMap<String, String>();
this.additionalInfo = new JsonObject();
}
this.additionalInfo.put(key, additionalInfoItem);
this.additionalInfo.addProperty(key, additionalInfoItem);
return this;
}

Expand All @@ -94,11 +95,11 @@ public BrAPIPedigreeNode putAdditionalInfoItem(String key, String additionalInfo
*
* @return additionalInfo
**/
public Map<String, String> getAdditionalInfo() {
public JsonObject getAdditionalInfo() {
return additionalInfo;
}

public void setAdditionalInfo(Map<String, String> additionalInfo) {
public void setAdditionalInfo(JsonObject additionalInfo) {
this.additionalInfo = additionalInfo;
}

Expand Down
11 changes: 11 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,17 @@

<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.7</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://s01.oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
Expand Down

0 comments on commit 42211ab

Please sign in to comment.