@@ -145,14 +145,14 @@ public ProviderEvaluation<Integer> getIntegerEvaluation(String key, Integer defa
145
145
}
146
146
147
147
@ Override
148
- public ProviderEvaluation <Structure > getObjectEvaluation (String key , Structure defaultValue ,
148
+ public ProviderEvaluation <Value > getObjectEvaluation (String key , Value defaultValue ,
149
149
EvaluationContext ctx ) {
150
150
ResolveObjectRequest request = ResolveObjectRequest .newBuilder ()
151
151
.setFlagKey (key )
152
152
.setContext (this .convertContext (ctx ))
153
153
.build ();
154
154
ResolveObjectResponse r = this .serviceStub .resolveObject (request );
155
- return ProviderEvaluation .<Structure >builder ()
155
+ return ProviderEvaluation .<Value >builder ()
156
156
.value (this .convertObjectResponse (r .getValue ()))
157
157
.variant (r .getVariant ())
158
158
.reason (this .mapReason (r .getReason ()))
@@ -174,10 +174,10 @@ private Reason mapReason(String flagDreason) {
174
174
}
175
175
176
176
/**
177
- * Recursively convert protobuf structure to openfeature structure .
177
+ * Recursively convert protobuf structure to openfeature value .
178
178
*/
179
- private Structure convertObjectResponse (com .google .protobuf .Struct protobuf ) {
180
- return new Structure ( this .convertProtobufMap (protobuf .getFieldsMap ()). asStructure (). asMap ());
179
+ private Value convertObjectResponse (com .google .protobuf .Struct protobuf ) {
180
+ return this .convertProtobufMap (protobuf .getFieldsMap ());
181
181
}
182
182
183
183
/**
@@ -268,9 +268,7 @@ private com.google.protobuf.Value convertPrimitive(Value value) {
268
268
builder .setBoolValue (value .asBoolean ());
269
269
} else if (value .isString ()) {
270
270
builder .setStringValue (value .asString ());
271
- } else if (value .isInteger ()) {
272
- builder .setNumberValue (Double .valueOf (value .asInteger ()));
273
- } else if (value .isDouble ()) {
271
+ } else if (value .isNumber ()) {
274
272
builder .setNumberValue (value .asDouble ());
275
273
} else {
276
274
builder .setNullValue (null );
@@ -290,7 +288,7 @@ private Value convertPrimitive(com.google.protobuf.Value protobuf) {
290
288
} else if (protobuf .hasNumberValue ()) {
291
289
value = new Value (protobuf .getNumberValue ());
292
290
} else {
293
- value = new Value (( Boolean ) null );
291
+ value = new Value ();
294
292
}
295
293
return value ;
296
294
}
0 commit comments