1111import java .util .Iterator ;
1212import java .util .List ;
1313
14- public class OneSignalSerializer {
15- static private HashMap <String , Object > convertSubscriptionStateToMap (OSSubscriptionState state ) {
14+ class OneSignalSerializer {
15+ private static HashMap <String , Object > convertSubscriptionStateToMap (OSSubscriptionState state ) {
1616 HashMap <String , Object > hash = new HashMap <>();
1717
1818 hash .put ("subscribed" , state .getSubscribed ());
@@ -23,15 +23,15 @@ static private HashMap<String, Object> convertSubscriptionStateToMap(OSSubscript
2323 return hash ;
2424 }
2525
26- static private HashMap <String , Object > convertPermissionStateToMap (OSPermissionState state ) {
26+ private static HashMap <String , Object > convertPermissionStateToMap (OSPermissionState state ) {
2727 HashMap <String , Object > permission = new HashMap <>();
2828
2929 permission .put ("enabled" , state .getEnabled ());
3030
3131 return permission ;
3232 }
3333
34- static private HashMap <String , Object > convertEmailSubscriptionStateToMap (OSEmailSubscriptionState state ) {
34+ private static HashMap <String , Object > convertEmailSubscriptionStateToMap (OSEmailSubscriptionState state ) {
3535 HashMap <String , Object > hash = new HashMap <>();
3636
3737 hash .put ("emailUserId" , state .getEmailUserId ());
@@ -41,7 +41,7 @@ static private HashMap<String, Object> convertEmailSubscriptionStateToMap(OSEmai
4141 return hash ;
4242 }
4343
44- static public HashMap <String , Object > convertPermissionSubscriptionStateToMap (OSPermissionSubscriptionState state ) {
44+ static HashMap <String , Object > convertPermissionSubscriptionStateToMap (OSPermissionSubscriptionState state ) {
4545 HashMap <String , Object > hash = new HashMap <>();
4646
4747 OSSubscriptionState subState = state .getSubscriptionStatus ();
@@ -60,7 +60,7 @@ static public HashMap<String, Object> convertPermissionSubscriptionStateToMap(OS
6060 return hash ;
6161 }
6262
63- static public HashMap <String , Object > convertSubscriptionStateChangesToMap (OSSubscriptionStateChanges changes ) {
63+ static HashMap <String , Object > convertSubscriptionStateChangesToMap (OSSubscriptionStateChanges changes ) {
6464 HashMap <String , Object > hash = new HashMap <>();
6565
6666 hash .put ("to" , convertSubscriptionStateToMap (changes .getTo ()));
@@ -69,7 +69,7 @@ static public HashMap<String, Object> convertSubscriptionStateChangesToMap(OSSub
6969 return hash ;
7070 }
7171
72- static public HashMap <String , Object > convertEmailSubscriptionStateChangesToMap (OSEmailSubscriptionStateChanges changes ) {
72+ static HashMap <String , Object > convertEmailSubscriptionStateChangesToMap (OSEmailSubscriptionStateChanges changes ) {
7373 HashMap <String , Object > hash = new HashMap <>();
7474
7575 hash .put ("to" , convertEmailSubscriptionStateToMap (changes .getTo ()));
@@ -78,7 +78,7 @@ static public HashMap<String, Object> convertEmailSubscriptionStateChangesToMap(
7878 return hash ;
7979 }
8080
81- static public HashMap convertPermissionStateChangesToMap (OSPermissionStateChanges changes ) {
81+ static HashMap convertPermissionStateChangesToMap (OSPermissionStateChanges changes ) {
8282 HashMap <String , Object > hash = new HashMap <>();
8383
8484 hash .put ("to" , convertPermissionStateToMap (changes .getTo ()));
@@ -87,7 +87,7 @@ static public HashMap convertPermissionStateChangesToMap(OSPermissionStateChange
8787 return hash ;
8888 }
8989
90- static private HashMap <String , Object > convertNotificationPayloadToMap (OSNotificationPayload payload ) throws JSONException {
90+ private static HashMap <String , Object > convertNotificationPayloadToMap (OSNotificationPayload payload ) throws JSONException {
9191 HashMap <String , Object > hash = new HashMap <>();
9292
9393 hash .put ("notificationId" , payload .notificationID );
@@ -140,7 +140,7 @@ static private HashMap<String, Object> convertNotificationPayloadToMap(OSNotific
140140 return hash ;
141141 }
142142
143- static public HashMap <String , Object > convertNotificationToMap (OSNotification notification ) throws JSONException {
143+ static HashMap <String , Object > convertNotificationToMap (OSNotification notification ) throws JSONException {
144144 HashMap <String , Object > hash = new HashMap <>();
145145
146146 hash .put ("payload" , convertNotificationPayloadToMap (notification .payload ));
@@ -161,7 +161,7 @@ static public HashMap<String, Object> convertNotificationToMap(OSNotification no
161161 return hash ;
162162 }
163163
164- static public HashMap <String , Object > convertNotificationOpenResultToMap (OSNotificationOpenResult openResult ) throws JSONException {
164+ static HashMap <String , Object > convertNotificationOpenResultToMap (OSNotificationOpenResult openResult ) throws JSONException {
165165 HashMap <String , Object > hash = new HashMap <>();
166166
167167 hash .put ("notification" , convertNotificationToMap (openResult .notification ));
@@ -170,7 +170,7 @@ static public HashMap<String, Object> convertNotificationOpenResultToMap(OSNotif
170170 return hash ;
171171 }
172172
173- static private HashMap <String , Object > convertNotificationActionToMap (OSNotificationAction action ) {
173+ private static HashMap <String , Object > convertNotificationActionToMap (OSNotificationAction action ) {
174174 HashMap <String , Object > hash = new HashMap <>();
175175
176176 hash .put ("id" , action .actionID );
@@ -186,7 +186,18 @@ static private HashMap<String, Object> convertNotificationActionToMap(OSNotifica
186186 return hash ;
187187 }
188188
189- static private HashMap <String , Object > convertAndroidBackgroundImageLayoutToMap (BackgroundImageLayout layout ) {
189+ static HashMap <String , Object > convertInAppMessageClickedActionToMap (OSInAppMessageAction action ) {
190+ HashMap <String , Object > hash = new HashMap <>();
191+
192+ hash .put ("click_name" , action .clickName );
193+ hash .put ("click_url" , action .clickUrl );
194+ hash .put ("first_click" , action .firstClick );
195+ hash .put ("closes_message" , action .closesMessage );
196+
197+ return hash ;
198+ }
199+
200+ private static HashMap <String , Object > convertAndroidBackgroundImageLayoutToMap (BackgroundImageLayout layout ) {
190201 HashMap <String , Object > hash = new HashMap <>();
191202
192203 hash .put ("image" , layout .image );
@@ -196,7 +207,7 @@ static private HashMap<String, Object> convertAndroidBackgroundImageLayoutToMap(
196207 return hash ;
197208 }
198209
199- static public HashMap <String , Object > convertJSONObjectToHashMap (JSONObject object ) throws JSONException {
210+ static HashMap <String , Object > convertJSONObjectToHashMap (JSONObject object ) throws JSONException {
200211 HashMap <String , Object > hash = new HashMap <>();
201212
202213 if (object == null || object == JSONObject .NULL )
@@ -224,7 +235,7 @@ static public HashMap<String, Object> convertJSONObjectToHashMap(JSONObject obje
224235 return hash ;
225236 }
226237
227- static private List <Object > convertJSONArrayToList (JSONArray array ) throws JSONException {
238+ private static List <Object > convertJSONArrayToList (JSONArray array ) throws JSONException {
228239 List <Object > list = new ArrayList <>();
229240
230241 for (int i = 0 ; i < array .length (); i ++) {
0 commit comments