/** * Sets or replaces all elements for {@link SessionInfo#getChecks() checks} list. * @param elements An iterable of checks elements * @return {@code this} builder for use in a chained invocation */ public final Builder checks(Iterable<String> elements) { checksBuilder = ImmutableList.builder(); return addAllChecks(elements); }
/** * Fill a builder with attribute values from the provided {@code SessionInfo} instance. * Regular attribute values will be replaced with those from the given instance. * Absent optional values will not replace present values. * Collection elements and entries will be added, not replaced. * @param instance The instance from which to copy values * @return {@code this} builder for use in a chained invocation */ public final Builder from(SessionInfo instance) { Preconditions.checkNotNull(instance, "instance"); createIndex(instance.getCreateIndex()); lockDelay(instance.getLockDelay()); Optional<String> nameOptional = instance.getName(); if (nameOptional.isPresent()) { name(nameOptional); } node(instance.getNode()); addAllChecks(instance.getChecks()); behavior(instance.getBehavior()); Optional<String> ttlOptional = instance.getTtl(); if (ttlOptional.isPresent()) { ttl(ttlOptional); } id(instance.getId()); return this; }
builder.addAllChecks(json.checks);