private AndroidConfig(Builder builder) { this.collapseKey = builder.collapseKey; if (builder.priority != null) { this.priority = builder.priority.name().toLowerCase(); } else { this.priority = null; } if (builder.ttl != null) { checkArgument(builder.ttl >= 0, "ttl must not be negative"); long seconds = TimeUnit.MILLISECONDS.toSeconds(builder.ttl); long subsecondNanos = TimeUnit.MILLISECONDS.toNanos(builder.ttl - seconds * 1000L); if (subsecondNanos > 0) { this.ttl = String.format("%d.%09ds", seconds, subsecondNanos); } else { this.ttl = String.format("%ds", seconds); } } else { this.ttl = null; } this.restrictedPackageName = builder.restrictedPackageName; this.data = builder.data.isEmpty() ? null : ImmutableMap.copyOf(builder.data); this.notification = builder.notification; }