Skip to content

Instantly share code, notes, and snippets.

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.1'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}
@thejibz
thejibz / TernaryNullChecking.java
Last active November 27, 2015 16:26
Generate a ternary null checking for a chained call.
/**
* Generate a ternary null checking for a chained call.
* a.getB().getC().getD().getE()
* =>
* (a != null
&& a.getB() != null
&& a.getB().getC() != null
&& a.getB().getC().getD() != null
&& a.getB().getC().getD().getE() != null)