Skip to content

Commit 80bff90

Browse files
committed
added support for project names
1 parent 62abfcf commit 80bff90

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [0.13.16]
5+
6+
## Added
7+
- Project now contains getName() for a user presentable name
8+
49
## [0.13.15]
510

611
### Changed

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ allprojects {
2323
}
2424

2525
project.ext {
26-
sdkVersion='0.13.15'
26+
sdkVersion='0.13.16'
2727
versionCode=1
2828

2929
compileSdkVersion=28

core/src/main/java/io/snabble/sdk/Project.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131

3232
public class Project {
3333
private String id;
34+
private String name;
3435

3536
private ProductDatabase productDatabase;
3637
private Shop[] shops;
@@ -100,6 +101,8 @@ void parse(JsonObject jsonObject) {
100101
throw new IllegalArgumentException("Project has no id");
101102
}
102103

104+
name = JsonUtils.getStringOpt(jsonObject, "name", id);
105+
103106
JsonObject links = jsonObject.get("links").getAsJsonObject();
104107
Set<String> linkKeys = links.keySet();
105108
for (String k : linkKeys) {
@@ -294,6 +297,10 @@ public String getId() {
294297
return id;
295298
}
296299

300+
public String getName() {
301+
return name;
302+
}
303+
297304
public String getTokensUrl() {
298305
return urls.get("tokens");
299306
}

0 commit comments

Comments
 (0)