@@ -145,14 +145,14 @@ public ProviderEvaluation<Integer> getIntegerEvaluation(String key, Integer defa
145145 }
146146
147147 @ Override
148- public ProviderEvaluation <Structure > getObjectEvaluation (String key , Structure defaultValue ,
148+ public ProviderEvaluation <Value > getObjectEvaluation (String key , Value defaultValue ,
149149 EvaluationContext ctx ) {
150150 ResolveObjectRequest request = ResolveObjectRequest .newBuilder ()
151151 .setFlagKey (key )
152152 .setContext (this .convertContext (ctx ))
153153 .build ();
154154 ResolveObjectResponse r = this .serviceStub .resolveObject (request );
155- return ProviderEvaluation .<Structure >builder ()
155+ return ProviderEvaluation .<Value >builder ()
156156 .value (this .convertObjectResponse (r .getValue ()))
157157 .variant (r .getVariant ())
158158 .reason (this .mapReason (r .getReason ()))
@@ -174,10 +174,10 @@ private Reason mapReason(String flagDreason) {
174174 }
175175
176176 /**
177- * Recursively convert protobuf structure to openfeature structure .
177+ * Recursively convert protobuf structure to openfeature value .
178178 */
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 ());
181181 }
182182
183183 /**
@@ -268,9 +268,7 @@ private com.google.protobuf.Value convertPrimitive(Value value) {
268268 builder .setBoolValue (value .asBoolean ());
269269 } else if (value .isString ()) {
270270 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 ()) {
274272 builder .setNumberValue (value .asDouble ());
275273 } else {
276274 builder .setNullValue (null );
@@ -290,7 +288,7 @@ private Value convertPrimitive(com.google.protobuf.Value protobuf) {
290288 } else if (protobuf .hasNumberValue ()) {
291289 value = new Value (protobuf .getNumberValue ());
292290 } else {
293- value = new Value (( Boolean ) null );
291+ value = new Value ();
294292 }
295293 return value ;
296294 }
0 commit comments