Skip to content

Commit

Permalink
Renamed Decision.Link.type to Decision.Link.description.
Browse files Browse the repository at this point in the history
  • Loading branch information
simonbrowndotje committed Mar 2, 2022
1 parent 0db7f1a commit 9d8ccbf
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ subprojects { proj ->

description = 'Structurizr'
group = 'com.structurizr'
version = '1.12.0'
version = '1.12.1'

repositories {
mavenCentral()
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
32 changes: 21 additions & 11 deletions structurizr-core/src/com/structurizr/documentation/Decision.java
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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
Expand All @@ -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;
}
Expand Down

0 comments on commit 9d8ccbf

Please sign in to comment.