Skip to content

Instantly share code, notes, and snippets.

View Syhids's full-sized avatar
🧗

Manuel Jiménez Torres Syhids

🧗
  • Adevinta
  • Barcelona
View GitHub Profile
@Syhids
Syhids / Preconditions.java
Last active November 6, 2015 12:59
Preconditions with better stacktraces for crash reporting tools. Credits to @pyricau. More info at http://www.slideshare.net/pyricau/crash-fast-furious
public class Preconditions {
public static <T> T checkNotNull(T t, String name) {
if (t == null) {
throw withPreconditionsTraceRemoved(new NullPointerException(name + " must not be null"));
}
return t;
}
public static <T extends CharSequence> T nonBlank(T value, String name) {
@Syhids
Syhids / gist:56f60bcbb42e8f1845d7
Last active August 29, 2015 14:04
Helper class to use the Parse API with Tasks (bolts library)
package eu.yesweapp.parse;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import bolts.Task;
import com.parse.DeleteCallback;
import com.parse.FindCallback;