org.immutables.fixture.jdkonly.BbzBuilder Maven / Gradle / Ivy
package org.immutables.fixture.jdkonly;
import java.util.Objects;
import java.util.Optional;
import java.util.OptionalInt;
import javax.annotation.Generated;
import javax.annotation.ParametersAreNonnullByDefault;
import javax.annotation.concurrent.NotThreadSafe;
/**
* {@code BbzBuilder} collects parameters and invokes the static factory method:
* {@code org.immutables.fixture.jdkonly.JdkOptionalBuilderFactory.bbz(..)}.
* Call the {@link #build()} method to get a result of type {@code int}.
* {@code BbzBuilder} is not thread-safe and generally should not be stored in a field or collection,
* but instead used immediately to create instances.
*/
@SuppressWarnings("all")
@ParametersAreNonnullByDefault
@Generated({"Immutables.generator", "JdkOptionalBuilderFactory.bbz"})
@NotThreadSafe
public final class BbzBuilder {
private Optional b = Optional.empty();
private OptionalInt c = OptionalInt.empty();
/**
* Creates a {@code BbzBuilder} factory builder.
* @param b {@code b} parameter
* @param c {@code c} parameter
*/
public BbzBuilder(Optional b, OptionalInt c) {
b(b);
c(c);
}
/**
* Initializes the optional value {@code b} to b.
* @param b The value for b
* @return {@code this} builder for use in a chained invocation
*/
private final BbzBuilder b(Optional b) {
this.b = Objects.requireNonNull(b, "b");
return this;
}
/**
* Initializes the optional value {@code c} to c.
* @param c The value for c
* @return {@code this} builder for use in a chained invocation
*/
private final BbzBuilder c(OptionalInt c) {
this.c = Objects.requireNonNull(c, "c");
return this;
}
/**
* Invokes {@code org.immutables.fixture.jdkonly.JdkOptionalBuilderFactory.bbz(..)} using the collected parameters and returns the result of the invocation
* @return A result of type {@code int}
* @throws java.lang.IllegalStateException if any required attributes are missing
*/
public int build() {
return JdkOptionalBuilderFactory.bbz(b, c);
}
}