This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@SuppressWarnings("unchecked") | |
@SafeVarargs | |
public static <T> List<T> sortBy(List<T> list, Function<? super T, ? super Comparable>... function) { | |
Comparator<T> comparator = (o1, o2) -> { | |
for (int i = 0; i < function.length; i++) { | |
Object obj1 = function[i].apply(o1); | |
Object obj2 = function[i].apply(o2); | |
int result; | |
if (obj1 == null || obj2 == null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
object AppLocalTime : AppLocalTimeBase() { | |
override fun saveServerDateTimeMls(millis: Long) = Prefs::serverDateTimeMls.set(millis) | |
override fun savePhoneDateTimeMls(millis: Long) = Prefs::phoneDateTimeMls.set(millis) | |
override fun savePhoneBootMillis(millis: Long) = Prefs::phonePhoneBootMls.set(millis) | |
override fun loadServerDateTimeMls(): Long = Prefs.serverDateTimeMls | |
override fun loadPhoneDateTimeMls(): Long = Prefs.phoneDateTimeMls | |
override fun loadPhoneBootMillis(): Long = Prefs.phonePhoneBootMls | |
override fun getServerDateFormat(): String = "yyyy-MM-dd HH:mm:ss ZZZZ" // sample 2017-04-24 15:14:39 +0000 | |
override fun getServerDateString(ondate: (String?) -> Unit, onError: (Throwable?) -> Unit) { | |
//ClientServer.Requests.getServerTime() |