/** * Sets or replaces all elements for {@link Atoi#getArgs() args} list. * @param elements An iterable of args elements * @return {@code this} builder for use in a chained invocation */ @CanIgnoreReturnValue @JsonProperty("args") public final Builder args(Iterable<String> elements) { this.args = ImmutableList.builder(); return addAllArgs(elements); }
/** * @param json A JSON-bindable data structure * @return An immutable value type * @deprecated Do not use this method directly, it exists only for the <em>Jackson</em>-binding infrastructure */ @Deprecated @JsonCreator(mode = JsonCreator.Mode.DELEGATING) static ImmutableAtoi fromJson(Json json) { ImmutableAtoi.Builder builder = ImmutableAtoi.builder(); if (json.args != null) { builder.addAllArgs(json.args); } if (json.returnValue != null) { builder.returnValue(json.returnValue); } if (json.name != null) { builder.name(json.name); } if (json.description != null) { builder.description(json.description); } return builder.build(); }
private void from(Object object) { if (object instanceof Function) { Function instance = (Function) object; addAllArgs(instance.getArgs()); returnValue(instance.getReturnValue()); } if (object instanceof Element) { Element instance = (Element) object; name(instance.getName()); Optional<String> descriptionOptional = instance.getDescription(); if (descriptionOptional.isPresent()) { description(descriptionOptional); } } }