From a7f25036478f2cb6cf968a5dcf6e94943c4cc7db Mon Sep 17 00:00:00 2001 From: glassjoseph Date: Mon, 13 Dec 2021 16:20:06 -0500 Subject: [PATCH] Display targetConstellation in constellationRelation's toString() if no content --- .github/workflows/release.yaml | 4 ++-- pom.xml | 2 +- .../org/snaccooperative/data/ConstellationRelation.java | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 602be3d..d86aea9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -41,8 +41,8 @@ jobs: GITHUB_TOKEN: ${{ github.token }} with: upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ./target/datamodel-1.2.1.jar - asset_name: datamodel-1.2.1.jar + asset_path: ./target/datamodel-1.2.2.jar + asset_name: datamodel-1.2.2.jar asset_content_type: application/java-archive - name: Publish package run: mvn --batch-mode deploy diff --git a/pom.xml b/pom.xml index 383bc9f..7942bf4 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.snaccooperative datamodel - 1.2.1 + 1.2.2 diff --git a/src/main/java/org/snaccooperative/data/ConstellationRelation.java b/src/main/java/org/snaccooperative/data/ConstellationRelation.java index 8724eba..d9baf50 100644 --- a/src/main/java/org/snaccooperative/data/ConstellationRelation.java +++ b/src/main/java/org/snaccooperative/data/ConstellationRelation.java @@ -307,7 +307,12 @@ public String getNote() * @return string A human-readable summary string of this object */ public String toString() { - return "Relation: " + (this.type != null ? this.type.getTerm() + " " : "") + this.content; + if (this.content != null) { + return "Relation: " + (this.type != null ? this.type.getTerm() + " " : "") + this.content; + } + else { + return "Relation: " + (this.type != null ? this.type.getTerm() + " " : "") + this.targetConstellation; + } } /**