Skip to content

Commit

Permalink
change map to hashmap
Browse files Browse the repository at this point in the history
  • Loading branch information
iMac committed Sep 26, 2023
1 parent 119be16 commit 34aa1f9
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ android {
minSdkVersion 21
targetSdkVersion 34
versionCode 50
versionName "2023.09.17"
versionName "2023.09.16"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/oneflow/analytics/OneFlow.java
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ public static void recordEvents(String eventName) {
* @param eventName : to recognize event and start survey if have any
* @param eventValues : will accept HashMap<String,Object>
*/
public static void recordEvents(String eventName, Map eventValues) {
public static void recordEvents(String eventName, HashMap eventValues) {

try {
if (!OFHelper.validateString(eventName.trim()).equalsIgnoreCase("NA")) {
Expand Down Expand Up @@ -478,7 +478,7 @@ public static void logUser(String uniqueId){
* @param uniqueId : to identify user uniquely, it could be e-mail id or any thing.
* @param userDetail : data related to user.
*/
public static void logUser(String uniqueId, Map<String, Object> userDetail) {
public static void logUser(String uniqueId, HashMap<String, Object> userDetail) {
OFHelper.v("1Flow", "1Flow logUser data stored 0");
// User id must not be empty
if (OFHelper.validateString(uniqueId).equalsIgnoreCase("NA")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private OFEventController(Context mContext) {
this.mContext = mContext;
}

public void storeEventsInDB(String eventName, Map<String, Object> eventValue, int value) {
public void storeEventsInDB(String eventName, HashMap<String, Object> eventValue, int value) {

OFHelper.v(tag, "Oneflow records inserted [" + eventName + "]value[" + eventValue + "]");
new OFEventDBRepoKT().insertEvents(mContext, eventName, eventValue, value, this, OFConstants.ApiHitType.insertEventsInDB);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.google.gson.annotations.SerializedName;
import com.oneflow.analytics.sdkdb.convertes.OFMapConverter;

import java.util.HashMap;
import java.util.Map;

@Entity (tableName = "RecordEvents")
Expand All @@ -47,7 +48,7 @@ public class OFRecordEventsTab {
@TypeConverters(OFMapConverter.class)
@ColumnInfo(name = "parameters")
@SerializedName("parameters")
private Map<String,Object> dataMap;
private HashMap<String,Object> dataMap;

@ColumnInfo(name = "time")
@SerializedName("time")
Expand Down Expand Up @@ -113,11 +114,11 @@ public void setEventName(String eventName) {
this.eventName = eventName;
}

public Map<String,Object> getDataMap() {
public HashMap<String,Object> getDataMap() {
return dataMap;
}

public void setDataMap(Map<String,Object> dataMap) {
public void setDataMap(HashMap<String,Object> dataMap) {
this.dataMap = dataMap;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;


Expand All @@ -36,7 +37,7 @@ public class OFRecordEventsTabToAPI implements Serializable {
private String _id;

@SerializedName("parameters")
private transient Map<String,Object> dataMap;
private transient HashMap<String,Object> dataMap;

@SerializedName("time")
private Long time;
Expand Down Expand Up @@ -84,11 +85,11 @@ public void setEventName(String eventName) {
this.eventName = eventName;
}

public Map<String,Object> getDataMap() {
public HashMap<String,Object> getDataMap() {
return dataMap;
}

public void setDataMap(Map<String,Object> dataMap) {
public void setDataMap(HashMap<String,Object> dataMap) {
this.dataMap = dataMap;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
public class OFLogUserRequest extends OFBaseModel {

@SerializedName("parameters")
private transient Map<String,Object> parameters;
private transient HashMap<String,Object> parameters;
@SerializedName("anonymous_user_id")
private String anonymous_user_id;
@SerializedName("user_id")
Expand All @@ -47,7 +47,7 @@ public Map<String,Object> getParameters() {
return parameters;
}

public void setParameters(Map<String,Object> parameters) {
public void setParameters(HashMap<String,Object> parameters) {
this.parameters = parameters;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import kotlinx.coroutines.launch
import java.util.*

class OFEventDBRepoKT {
fun insertEvents(context: Context, eventName: String?, data: Map<String?, Any?>?, value: Int, mrh: OFMyResponseHandlerOneFlow, type: ApiHitType?) {
fun insertEvents(context: Context, eventName: String?, data: HashMap<String?, Any?>?, value: Int, mrh: OFMyResponseHandlerOneFlow, type: ApiHitType?) {
OFHelper.v("EventDBRepoKT.insertEvents", "1Flow reached at insertEvent method")

val job = Job()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
//@ProvidedTypeConverter
public class OFMapConverter implements Serializable {
@TypeConverter
public Map<String, Object> stringToMap(String value) {
public HashMap<String, Object> stringToMap(String value) {
return new Gson().fromJson(value, new TypeToken<HashMap<String, Object>>(){}.getType());
}

@TypeConverter
public String mapToString(Map<String, Object> map) {
public String mapToString(HashMap<String, Object> map) {
if(map == null)
return "";
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

public interface OFConstants {

String currentVersion = "2023.09.17";//2023.07.14;
String currentVersion = "2023.09.16";//2023.07.14;
String MODE = "dev";//"prod";//"beta";//

String cacheFileName = "logic-engine.js";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ public static double[] getScreenSize(Activity context) {
* @param map
* @return
*/
public static Map<String, Object> checkDateInHashMap(Map<String, Object> map) {
public static HashMap<String, Object> checkDateInHashMap(HashMap<String, Object> map) {

Gson gson = new Gson();
gson.toJson(map);
Expand Down

0 comments on commit 34aa1f9

Please sign in to comment.