From 9d8ccbff823d6095fb5e1dbde2e55e69d872b15f Mon Sep 17 00:00:00 2001 From: Simon Brown Date: Wed, 2 Mar 2022 13:50:12 +0000 Subject: [PATCH] Renamed `Decision.Link.type` to `Decision.Link.description`. --- build.gradle | 2 +- docs/changelog.md | 4 +++ docs/getting-started.md | 2 +- .../structurizr/documentation/Decision.java | 32 ++++++++++++------- 4 files changed, 27 insertions(+), 13 deletions(-) diff --git a/build.gradle b/build.gradle index e66982ca..f3df6a52 100644 --- a/build.gradle +++ b/build.gradle @@ -14,7 +14,7 @@ subprojects { proj -> description = 'Structurizr' group = 'com.structurizr' - version = '1.12.0' + version = '1.12.1' repositories { mavenCentral() diff --git a/docs/changelog.md b/docs/changelog.md index d57bd0f0..909387b8 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -1,5 +1,9 @@ # Changelog +## 1.12.1 (2nd March 2022) + +- Renamed `Decision.Link.type` to `Decision.Link.description`. + ## 1.12.0 (1st March 2022) - Breaking API changes to how documentation and decisions are managed. diff --git a/docs/getting-started.md b/docs/getting-started.md index 963ec0c1..43673ba7 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -12,7 +12,7 @@ The Structurizr for Java binaries are hosted on [Maven Central](https://repo1.ma Name | Description ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- -com.structurizr:structurizr-client:1.12.0 | The Structurizr API client library. +com.structurizr:structurizr-client:1.12.1 | The Structurizr API client library. ## 2. Create a Java program diff --git a/structurizr-core/src/com/structurizr/documentation/Decision.java b/structurizr-core/src/com/structurizr/documentation/Decision.java index 4f1c60a2..bb0ee574 100644 --- a/structurizr-core/src/com/structurizr/documentation/Decision.java +++ b/structurizr-core/src/com/structurizr/documentation/Decision.java @@ -128,18 +128,19 @@ public int hashCode() { */ public static final class Link { - private String type; private String id; + private String description = ""; Link() { } - Link(String id, String type) { + Link(String id, String description) { if (StringUtils.isNullOrEmpty(id)) { - throw new IllegalArgumentException("Link ID must be specfied"); + throw new IllegalArgumentException("Link ID must be specified"); } - this.id = id; - this.type = type; + + setId(id); + setDescription(description); } public String getId() { @@ -150,12 +151,21 @@ void setId(String id) { this.id = id; } - public String getType() { - return type; + /** + * Gets the description of this link. + * + * @return a String description + */ + public String getDescription() { + return description; } - void setType(String type) { - this.type = type; + void setDescription(String description) { + if (!StringUtils.isNullOrEmpty(description)) { + this.description = description; + } else { + this.description = ""; + } } @Override @@ -165,13 +175,13 @@ public boolean equals(Object o) { Link link = (Link) o; - if (!type.equals(link.type)) return false; + if (!description.equals(link.description)) return false; return id.equals(link.id); } @Override public int hashCode() { - int result = type.hashCode(); + int result = description.hashCode(); result = 31 * result + id.hashCode(); return result; }