Skip to content

Commit

Permalink
Add adapter to utils
Browse files Browse the repository at this point in the history
Signed-off-by: bharathappali <abharath@redhat.com>
  • Loading branch information
bharathappali committed Oct 8, 2024
1 parent bd82175 commit ff1873c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/com/autotune/utils/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
package com.autotune.utils;


import com.autotune.analyzer.adapters.DeviceDetailsAdapter;
import com.autotune.analyzer.adapters.RecommendationItemAdapter;
import com.autotune.analyzer.utils.AnalyzerConstants;
import com.autotune.analyzer.utils.GsonUTCDateAdapter;
import com.autotune.common.data.result.ContainerData;
import com.autotune.common.data.system.info.device.DeviceDetails;
import com.google.gson.ExclusionStrategy;
import com.google.gson.FieldAttributes;
import com.google.gson.Gson;
Expand Down Expand Up @@ -171,6 +173,7 @@ public static <T> T getClone(T object, Class<T> classMetadata) {
.enableComplexMapKeySerialization()
.registerTypeAdapter(Date.class, new GsonUTCDateAdapter())
.registerTypeAdapter(AnalyzerConstants.RecommendationItem.class, new RecommendationItemAdapter())
.registerTypeAdapter(DeviceDetails.class, new DeviceDetailsAdapter())
.create();

String serialisedString = gson.toJson(object);
Expand Down

0 comments on commit ff1873c

Please sign in to comment.