Class ImmutableSiteVisitorOutput.Builder
- java.lang.Object
-
- io.thestencil.staticontent.spi.visitor.ImmutableSiteVisitorOutput.Builder
-
- Enclosing class:
- ImmutableSiteVisitorOutput
@NotThreadSafe public static final class ImmutableSiteVisitorOutput.Builder extends Object
Builds instances of typeImmutableSiteVisitorOutput. Initialize attributes and then invoke thebuild()method to create an immutable instance.Builderis not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.
-
-
Method Summary
-
-
-
Method Detail
-
from
@CanIgnoreReturnValue public final ImmutableSiteVisitorOutput.Builder from(SiteVisitor.SiteVisitorOutput instance)
Fill a builder with attribute values from the providedSiteVisitorOutputinstance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values. Collection elements and entries will be added, not replaced.- Parameters:
instance- The instance from which to copy values- Returns:
thisbuilder for use in a chained invocation
-
addMessage
@CanIgnoreReturnValue public final ImmutableSiteVisitorOutput.Builder addMessage(SiteVisitor.Message element)
Adds one element tomessagelist.- Parameters:
element- A message element- Returns:
thisbuilder for use in a chained invocation
-
addMessage
@CanIgnoreReturnValue public final ImmutableSiteVisitorOutput.Builder addMessage(SiteVisitor.Message... elements)
Adds elements tomessagelist.- Parameters:
elements- An array of message elements- Returns:
thisbuilder for use in a chained invocation
-
message
@CanIgnoreReturnValue public final ImmutableSiteVisitorOutput.Builder message(Iterable<? extends SiteVisitor.Message> elements)
Sets or replaces all elements formessagelist.- Parameters:
elements- An iterable of message elements- Returns:
thisbuilder for use in a chained invocation
-
addAllMessage
@CanIgnoreReturnValue public final ImmutableSiteVisitorOutput.Builder addAllMessage(Iterable<? extends SiteVisitor.Message> elements)
Adds elements tomessagelist.- Parameters:
elements- An iterable of message elements- Returns:
thisbuilder for use in a chained invocation
-
addSites
@CanIgnoreReturnValue public final ImmutableSiteVisitorOutput.Builder addSites(MigrationBuilder.LocalizedSite element)
Adds one element tositeslist.- Parameters:
element- A sites element- Returns:
thisbuilder for use in a chained invocation
-
addSites
@CanIgnoreReturnValue public final ImmutableSiteVisitorOutput.Builder addSites(MigrationBuilder.LocalizedSite... elements)
Adds elements tositeslist.- Parameters:
elements- An array of sites elements- Returns:
thisbuilder for use in a chained invocation
-
sites
@CanIgnoreReturnValue public final ImmutableSiteVisitorOutput.Builder sites(Iterable<? extends MigrationBuilder.LocalizedSite> elements)
Sets or replaces all elements forsiteslist.- Parameters:
elements- An iterable of sites elements- Returns:
thisbuilder for use in a chained invocation
-
addAllSites
@CanIgnoreReturnValue public final ImmutableSiteVisitorOutput.Builder addAllSites(Iterable<? extends MigrationBuilder.LocalizedSite> elements)
Adds elements tositeslist.- Parameters:
elements- An iterable of sites elements- Returns:
thisbuilder for use in a chained invocation
-
build
public ImmutableSiteVisitorOutput build()
Builds a newImmutableSiteVisitorOutput.- Returns:
- An immutable instance of SiteVisitorOutput
- Throws:
IllegalStateException- if any required attributes are missing
-
-