spUtil工具類的封裝

2021-09-06 09:46:22 字數 667 閱讀 1043

工具類的作用是為了讓我們更方便的使用,一次封裝,多次使用,也是乙個合格的工程師必備的**技術,下面就是sp存值和取值的工具類封裝
public class sputil 

}else if(value instanceof boolean)

else if(value instanceof float)

else if(value instanceof float)else if(value instanceof integer)else

boolean commit = edit.commit();

return commit;

}public static string getstring(string key,string array)

public static int getint(string key,int defualt)

public static boolean getsb(string key,boolean defualt)

public static long getlong(string key,long defualt)

//摧毀方法

public static void remove(string key)

}

音效工具類的封裝

與單例類的比較 類方法的特點 import inte ce sppsoundplaymanager nsobject param name 聲音檔名 帶字尾 param alert 是否振動 void playsoundwithname nsstring name alert bool alert ...

分頁工具類的封裝

public class pageabletools 獲取基礎分頁物件,每頁條數預設15條 預設以id降序排序 param page 獲取第幾頁 return public static pageable basicpage integer page 獲取基礎分頁物件,每頁條數預設15條 param...

FastJson封裝的工具類

新增fastjson依賴 com.alibabagroupid fastjsonartifactid 1.2.62version dependency jsonutils 工具類 基於fastjson封裝json public class jsonutils static 將乙個物件裝換為json字...