Target Builder
An abstract base for builders that create Message instances which have a Target and a FieldMask as attributes.
The Target matching the builder configuration is created with buildTarget, while the FieldMask is composed with composeMask.
The public API of this class is inspired by SQL syntax:
select(Customer.class) // returning <AbstractTargetBuilder> descendant instance
.byId(westCoastCustomerIds())
.withMask("name", "address", "email")
.where(eq("type", "permanent"),
eq("discountPercent", 10),
eq("companySize", Company.Size.SMALL))
.build();
Content copied to clipboard
Calling any of the builder methods overrides the previous call of the given method or any of its overloads. For example, calling sequentially:
builder.withMask(mask1)
.withMask(mask2)
// optionally some other invocations
.withMask(mask3)
.build();
Content copied to clipboard
builder.withMask(mask3)
.build();
Content copied to clipboard
Parameters
<T>
a type of the message which is returned by the implementations build
<B>
a type of the builder implementations