Skip to content

Commit cc28af8

Browse files
committed
Fix returning properties for new recommendation endpoints (#3)
1 parent ecbb9d4 commit cc28af8

File tree

4 files changed

+4
-6
lines changed

4 files changed

+4
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The client is available in the [Maven Central Repository](https://mvnrepository.
1313
<dependency>
1414
<groupId>com.recombee</groupId>
1515
<artifactId>api-client</artifactId>
16-
<version>2.0.0</version>
16+
<version>2.0.1</version>
1717
</dependency>
1818
```
1919

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
<groupId>com.recombee</groupId>
88
<artifactId>api-client</artifactId>
9-
<version>2.0.0</version>
9+
<version>2.0.1</version>
1010
<name>Recombee API Client</name>
1111
<description>A client library for easy use of the Recombee recommendation API</description>
1212
<url>http://recombee.com</url>

src/main/java/com/recombee/api_client/RecombeeClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public class RecombeeClient {
8585

8686
final int BATCH_MAX_SIZE = 10000; //Maximal number of requests within one batch request
8787

88-
final String USER_AGENT = "recombee-java-api-client/2.0.0";
88+
final String USER_AGENT = "recombee-java-api-client/2.0.1";
8989

9090
private final OkHttpClient httpClient = new OkHttpClient();
9191

src/main/java/com/recombee/api_client/bindings/Recommendation.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public class Recommendation extends RecombeeBinding {
1212
* Property values of the recommended item (only if the recommendation requested was set to return property values)
1313
*/
1414
protected Map<String, Object> values;
15-
protected boolean valuesAreSet;
1615

1716
public Recommendation() {}
1817

@@ -25,7 +24,6 @@ public Recommendation(String id, Map<String, Object> values)
2524
{
2625
this.id = id;
2726
this.values = values;
28-
this.valuesAreSet = true;
2927
}
3028

3129
public String getId() {
@@ -34,7 +32,7 @@ public String getId() {
3432

3533
public Map<String, Object> getValues() {
3634

37-
if(!this.valuesAreSet)
35+
if(values == null)
3836
throw new IllegalStateException("getValues() is possible only if the recommendation requested was set to return property values (invoke setReturnProperties(true))");
3937

4038
return this.values;

0 commit comments

Comments
 (0)