/** * Copy the current immutable object by setting a value for the {@link GoToNextIteration#getName() name} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for name * @return A modified copy of the {@code this} object */ public final ImmutableGoToNextIteration withName(String value) { if (this.name.equals(value)) return this; String newValue = Objects.requireNonNull(value, "name"); return new ImmutableGoToNextIteration(newValue, this.description); }
/** * This instance is equal to all instances of {@code ImmutableGoToNextIteration} that have equal attribute values. * @return {@code true} if {@code this} is equal to {@code another} instance */ @Override public boolean equals(@Nullable Object another) { if (this == another) return true; return another instanceof ImmutableGoToNextIteration && equalTo((ImmutableGoToNextIteration) another); }
private List<Element> buildGoToNextIterations(final MethodCall method, final ExitStatus exitStatus) { ImmutableList.Builder<Element> builder = ImmutableList.builder(); buildJavaScriptIfNeeded(exitStatus).ifPresent(builder::add); builder.add(ImmutableGoToNextIteration.builder() .name(MethodUtils.unquote(method.getName())) .build()); return builder.build(); }
/** * Creates an immutable copy of a {@link GoToNextIteration} value. * Uses accessors to get values to initialize the new immutable instance. * If an instance is already immutable, it is returned as is. * @param instance The instance to copy * @return A copied immutable GoToNextIteration instance */ public static ImmutableGoToNextIteration copyOf(GoToNextIteration instance) { if (instance instanceof ImmutableGoToNextIteration) { return (ImmutableGoToNextIteration) instance; } return ImmutableGoToNextIteration.builder() .from(instance) .build(); }
/** * @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 ImmutableGoToNextIteration fromJson(Json json) { ImmutableGoToNextIteration.Builder builder = ImmutableGoToNextIteration.builder(); if (json.name != null) { builder.name(json.name); } if (json.description != null) { builder.description(json.description); } return builder.build(); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link GoToNextIteration#getDescription() description} attribute. * @param value The value for description * @return A modified copy of {@code this} object */ public final ImmutableGoToNextIteration withDescription(String value) { @Nullable String newValue = Objects.requireNonNull(value, "description"); if (Objects.equals(this.description, newValue)) return this; return new ImmutableGoToNextIteration(this.name, newValue); }
/** * Copy the current immutable object by setting an optional value for the {@link GoToNextIteration#getDescription() description} attribute. * An equality check is used on inner nullable value to prevent copying of the same value by returning {@code this}. * @param optional A value for description * @return A modified copy of {@code this} object */ public final ImmutableGoToNextIteration withDescription(Optional<String> optional) { @Nullable String value = optional.orElse(null); if (Objects.equals(this.description, value)) return this; return new ImmutableGoToNextIteration(this.name, value); }
/** * Builds a new {@link ImmutableGoToNextIteration ImmutableGoToNextIteration}. * @return An immutable instance of GoToNextIteration * @throws java.lang.IllegalStateException if any required attributes are missing */ public ImmutableGoToNextIteration build() { if (initBits != 0) { throw new IllegalStateException(formatRequiredAttributesMessage()); } return new ImmutableGoToNextIteration(name, description); }