/** * Copy the current immutable object with elements that replace the content of {@link PostTextRequest#getValidators() validators}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withValidators(Validator... elements) { ImmutableList<Validator> newValue = ImmutableList.copyOf(elements); return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, this.parameters, this.extractors, newValue, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * This instance is equal to all instances of {@code ImmutablePostTextRequest} 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 ImmutablePostTextRequest && equalTo((ImmutablePostTextRequest) another); }
/** * Creates an immutable copy of a {@link PostTextRequest} 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 PostTextRequest instance */ public static ImmutablePostTextRequest copyOf(PostTextRequest instance) { if (instance instanceof ImmutablePostTextRequest) { return (ImmutablePostTextRequest) instance; } return ImmutablePostTextRequest.builder() .from(instance) .build(); }
final ImmutablePostTextRequest.Builder builder = ImmutablePostTextRequest.builder() .name(mainUrl.getPath()) .path(mainUrl.getPath())
/** * Copy the current immutable object with elements that replace the content of {@link PostTextRequest#getHeaders() headers}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withHeaders(Header... elements) { ImmutableList<Header> newValue = ImmutableList.copyOf(elements); return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, this.parameters, this.extractors, this.validators, newValue, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object with elements that replace the content of {@link PostTextRequest#getPostParameters() postParameters}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of postParameters elements to set * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withPostParameters(Iterable<? extends Parameter> elements) { if (this.postParameters == elements) return this; ImmutableList<Parameter> newValue = ImmutableList.copyOf(elements); return new ImmutablePostTextRequest( this.data, newValue, this.path, this.server, this.httpMethod, this.parameters, this.extractors, this.validators, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object with elements that replace the content of {@link PostTextRequest#getValidators() validators}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of validators elements to set * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withValidators(Iterable<? extends Validator> elements) { if (this.validators == elements) return this; ImmutableList<Validator> newValue = ImmutableList.copyOf(elements); return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, this.parameters, this.extractors, newValue, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object by setting a value for the {@link PostTextRequest#getHttpMethod() httpMethod} attribute. * A value equality check is used to prevent copying of the same value by returning {@code this}. * @param value A new value for httpMethod * @return A modified copy of the {@code this} object */ public final ImmutablePostTextRequest withHttpMethod(Request.HttpMethod value) { if (this.httpMethod == value) return this; Request.HttpMethod newValue = Objects.requireNonNull(value, "httpMethod"); return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, newValue, this.parameters, this.extractors, this.validators, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object with elements that replace the content of {@link PostTextRequest#getParameters() parameters}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of parameters elements to set * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withParameters(Iterable<? extends Parameter> elements) { if (this.parameters == elements) return this; ImmutableList<Parameter> newValue = ImmutableList.copyOf(elements); return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, newValue, this.extractors, this.validators, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object with elements that replace the content of {@link PostTextRequest#getHeaders() headers}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of headers elements to set * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withHeaders(Iterable<? extends Header> elements) { if (this.headers == elements) return this; ImmutableList<Header> newValue = ImmutableList.copyOf(elements); return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, this.parameters, this.extractors, this.validators, newValue, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object with elements that replace the content of {@link PostTextRequest#getPostParameters() postParameters}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withPostParameters(Parameter... elements) { ImmutableList<Parameter> newValue = ImmutableList.copyOf(elements); return new ImmutablePostTextRequest( this.data, newValue, this.path, this.server, this.httpMethod, this.parameters, this.extractors, this.validators, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object with elements that replace the content of {@link PostTextRequest#getParameters() parameters}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withParameters(Parameter... elements) { ImmutableList<Parameter> newValue = ImmutableList.copyOf(elements); return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, newValue, this.extractors, this.validators, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object with elements that replace the content of {@link PostTextRequest#getExtractors() extractors}. * @param elements The elements to set * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withExtractors(VariableExtractor... elements) { ImmutableList<VariableExtractor> newValue = ImmutableList.copyOf(elements); return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, this.parameters, newValue, this.validators, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object with elements that replace the content of {@link PostTextRequest#getExtractors() extractors}. * A shallow reference equality check is used to prevent copying of the same value by returning {@code this}. * @param elements An iterable of extractors elements to set * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withExtractors(Iterable<? extends VariableExtractor> elements) { if (this.extractors == elements) return this; ImmutableList<VariableExtractor> newValue = ImmutableList.copyOf(elements); return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, this.parameters, newValue, this.validators, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link PostTextRequest#getRecordedFiles() recordedFiles} attribute. * @param value The value for recordedFiles * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withRecordedFiles(RecordedFiles value) { @Nullable RecordedFiles newValue = Objects.requireNonNull(value, "recordedFiles"); if (this.recordedFiles == newValue) return this; return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, this.parameters, this.extractors, this.validators, this.headers, this.contentType, newValue, this.name, this.description); }
/** * Copy the current immutable object by setting a value for the {@link PostTextRequest#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 ImmutablePostTextRequest withName(String value) { if (this.name.equals(value)) return this; String newValue = Objects.requireNonNull(value, "name"); return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, this.parameters, this.extractors, this.validators, this.headers, this.contentType, this.recordedFiles, newValue, this.description); }
/** * Copy the current immutable object by setting a value for the {@link PostTextRequest#getData() data} attribute. * An equals check used to prevent copying of the same value by returning {@code this}. * @param value A new value for data * @return A modified copy of the {@code this} object */ public final ImmutablePostTextRequest withData(String value) { if (this.data.equals(value)) return this; String newValue = Objects.requireNonNull(value, "data"); return new ImmutablePostTextRequest( newValue, this.postParameters, this.path, this.server, this.httpMethod, this.parameters, this.extractors, this.validators, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object by setting an optional value for the {@link PostTextRequest#getServer() server} attribute. * A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning {@code this}. * @param optional A value for server * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withServer(Optional<? extends Server> optional) { @Nullable Server value = optional.orElse(null); if (this.server == value) return this; return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, value, this.httpMethod, this.parameters, this.extractors, this.validators, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }
/** * Copy the current immutable object by setting an optional value for the {@link PostTextRequest#getRecordedFiles() recordedFiles} attribute. * A shallow reference equality check is used on unboxed optional value to prevent copying of the same value by returning {@code this}. * @param optional A value for recordedFiles * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withRecordedFiles(Optional<? extends RecordedFiles> optional) { @Nullable RecordedFiles value = optional.orElse(null); if (this.recordedFiles == value) return this; return new ImmutablePostTextRequest( this.data, this.postParameters, this.path, this.server, this.httpMethod, this.parameters, this.extractors, this.validators, this.headers, this.contentType, value, this.name, this.description); }
/** * Copy the current immutable object by setting a <i>present</i> value for the optional {@link PostTextRequest#getPath() path} attribute. * @param value The value for path * @return A modified copy of {@code this} object */ public final ImmutablePostTextRequest withPath(String value) { @Nullable String newValue = Objects.requireNonNull(value, "path"); if (Objects.equals(this.path, newValue)) return this; return new ImmutablePostTextRequest( this.data, this.postParameters, newValue, this.server, this.httpMethod, this.parameters, this.extractors, this.validators, this.headers, this.contentType, this.recordedFiles, this.name, this.description); }