Skip to content

Commit 0337248

Browse files
author
danf
committed
Small interface fixes
1 parent 5124c4f commit 0337248

File tree

15 files changed

+183
-17
lines changed

15 files changed

+183
-17
lines changed

api/src/main/java/com/jfrog/bintray/client/api/details/PackageDetails.java

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
package com.jfrog.bintray.client.api.details;
22

33
import com.jfrog.bintray.client.api.ObjectMapperHelper;
4-
import org.codehaus.jackson.annotate.JsonCreator;
5-
import org.codehaus.jackson.annotate.JsonIgnore;
6-
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
7-
import org.codehaus.jackson.annotate.JsonProperty;
4+
import org.codehaus.jackson.annotate.*;
85
import org.codehaus.jackson.map.ObjectMapper;
96
import org.joda.time.DateTime;
107

8+
import java.util.HashMap;
119
import java.util.List;
10+
import java.util.Map;
1211

1312
/**
1413
* This class is used to serialize and deserialize the needed json to
@@ -70,10 +69,22 @@ public class PackageDetails {
7069
private List<String> systemIds;
7170
@JsonProperty(value = "vcs_url")
7271
private String vcsUrl;
73-
7472
@JsonIgnore
7573
private List<Attribute> attributes;
7674

75+
//All other props that don't have specific fields
76+
private Map<String, Object> other = new HashMap<>();
77+
78+
@JsonAnySetter
79+
public void set(String name, Object value) {
80+
other.put(name, value);
81+
}
82+
83+
@JsonAnyGetter
84+
public Map<String, Object> other() {
85+
return other;
86+
}
87+
7788
@JsonCreator
7889
public PackageDetails() {
7990
}

api/src/main/java/com/jfrog/bintray/client/api/details/ProductDetails.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.jfrog.bintray.client.api.details;
22

33
import com.jfrog.bintray.client.api.ObjectMapperHelper;
4-
import org.codehaus.jackson.annotate.JsonIgnore;
5-
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
6-
import org.codehaus.jackson.annotate.JsonProperty;
4+
import org.codehaus.jackson.annotate.*;
75
import org.codehaus.jackson.map.ObjectMapper;
86
import org.joda.time.DateTime;
97

8+
import java.util.HashMap;
109
import java.util.List;
10+
import java.util.Map;
1111

1212
/**
1313
* This class is used to serialize and deserialize the needed json to
@@ -40,6 +40,19 @@ public class ProductDetails {
4040
@JsonProperty(value = "sign_url_expiry")
4141
Integer signUrlExpiry;
4242

43+
//All other props that don't have specific fields
44+
private Map<String, Object> other = new HashMap<>();
45+
46+
@JsonAnySetter
47+
public void set(String name, Object value) {
48+
other.put(name, value);
49+
}
50+
51+
@JsonAnyGetter
52+
public Map<String, Object> other() {
53+
return other;
54+
}
55+
4356
public String getName() {
4457
return name;
4558
}

api/src/main/java/com/jfrog/bintray/client/api/details/RepositoryDetails.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.jfrog.bintray.client.api.details;
22

33
import com.jfrog.bintray.client.api.ObjectMapperHelper;
4-
import org.codehaus.jackson.annotate.JsonIgnore;
5-
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
6-
import org.codehaus.jackson.annotate.JsonProperty;
4+
import org.codehaus.jackson.annotate.*;
75
import org.codehaus.jackson.map.ObjectMapper;
86
import org.joda.time.DateTime;
97

8+
import java.util.HashMap;
109
import java.util.List;
10+
import java.util.Map;
1111

1212
/**
1313
* This class is used to serialize and deserialize the needed json to
@@ -42,6 +42,19 @@ public class RepositoryDetails {
4242
@JsonIgnore
4343
Boolean updateExisting; //Property is not used in the Bintray API but Artifactory uses is in it's Bintray integration
4444

45+
//All other props that don't have specific fields
46+
private Map<String, Object> other = new HashMap<>();
47+
48+
@JsonAnySetter
49+
public void set(String name, Object value) {
50+
other.put(name, value);
51+
}
52+
53+
@JsonAnyGetter
54+
public Map<String, Object> other() {
55+
return other;
56+
}
57+
4558
public static ObjectMapper getObjectMapper() {
4659
return ObjectMapperHelper.get();
4760
}

api/src/main/java/com/jfrog/bintray/client/api/details/SubjectDetails.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
package com.jfrog.bintray.client.api.details;
22

33
import com.jfrog.bintray.client.api.ObjectMapperHelper;
4+
import org.codehaus.jackson.annotate.JsonAnyGetter;
5+
import org.codehaus.jackson.annotate.JsonAnySetter;
46
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
57
import org.codehaus.jackson.annotate.JsonProperty;
68
import org.codehaus.jackson.map.ObjectMapper;
79
import org.joda.time.DateTime;
810

11+
import java.util.HashMap;
912
import java.util.List;
13+
import java.util.Map;
1014

1115
/**
1216
* This class is used to serialize and deserialize the needed json to
@@ -35,6 +39,19 @@ public class SubjectDetails {
3539
@JsonProperty("quota_used_bytes")
3640
Long quotaUsedBytes;
3741

42+
//All other props that don't have specific fields
43+
private Map<String, Object> other = new HashMap<>();
44+
45+
@JsonAnySetter
46+
public void set(String name, Object value) {
47+
other.put(name, value);
48+
}
49+
50+
@JsonAnyGetter
51+
public Map<String, Object> other() {
52+
return other;
53+
}
54+
3855
public static ObjectMapper getObjectMapper() {
3956
return ObjectMapperHelper.get();
4057
}

api/src/main/java/com/jfrog/bintray/client/api/details/VersionDetails.java

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
package com.jfrog.bintray.client.api.details;
22

33
import com.jfrog.bintray.client.api.ObjectMapperHelper;
4-
import org.codehaus.jackson.annotate.JsonIgnore;
5-
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
6-
import org.codehaus.jackson.annotate.JsonProperty;
4+
import org.codehaus.jackson.annotate.*;
75
import org.codehaus.jackson.map.ObjectMapper;
86
import org.joda.time.DateTime;
97

8+
import java.util.HashMap;
109
import java.util.List;
10+
import java.util.Map;
1111

1212
/**
1313
* This class is used to serialize and deserialize the needed json to
@@ -54,6 +54,19 @@ public class VersionDetails {
5454
@JsonProperty("vcs_tag")
5555
private String vcsTag;
5656

57+
//All other props that don't have specific fields
58+
private Map<String, Object> other = new HashMap<>();
59+
60+
@JsonAnySetter
61+
public void set(String name, Object value) {
62+
other.put(name, value);
63+
}
64+
65+
@JsonAnyGetter
66+
public Map<String, Object> other() {
67+
return other;
68+
}
69+
5770
public VersionDetails() {
5871

5972
}

api/src/main/java/com/jfrog/bintray/client/api/model/Pkg.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,6 @@ public interface Pkg {
3838
List<String> linkedToRepos();
3939

4040
List<String> systemIds();
41+
42+
Object getFieldByKey(String key);
4143
}

api/src/main/java/com/jfrog/bintray/client/api/model/Product.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ public interface Product {
2424
List<String> getPackages();
2525

2626
List<String> getVersions();
27+
28+
Object getFieldByKey(String key);
2729
}

api/src/main/java/com/jfrog/bintray/client/api/model/Repository.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ public interface Repository {
1313

1414
String getOwner();
1515

16+
String getType();
17+
18+
Boolean isPrivate();
19+
20+
Boolean isPremium();
21+
1622
String getDesc();
1723

1824
List<String> getLabels();
1925

2026
DateTime getCreated();
2127

2228
Integer getPackageCount();
29+
30+
Object getFieldByKey(String key);
2331
}

api/src/main/java/com/jfrog/bintray/client/api/model/Subject.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,6 @@ public interface Subject {
2424
DateTime getRegistered();
2525

2626
Long getQuotaUsedBytes();
27+
28+
Object getFieldByKey(String key);
2729
}

api/src/main/java/com/jfrog/bintray/client/api/model/Version.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ public interface Version {
3232
Integer ordinal();
3333

3434
String vcsTag();
35+
36+
Object getFieldByKey(String key);
3537
}

0 commit comments

Comments
 (0)