Class ImmutableSites.Builder

  • Enclosing class:
    ImmutableSites

    @NotThreadSafe
    public static final class ImmutableSites.Builder
    extends Object
    Builds instances of type ImmutableSites. Initialize attributes and then invoke the build() method to create an immutable instance.

    Builder is not thread-safe and generally should not be stored in a field or collection, but instead used immediately to create instances.

    • Method Detail

      • from

        @CanIgnoreReturnValue
        public final ImmutableSites.Builder from​(SiteVisitor.Sites instance)
        Fill a builder with attribute values from the provided Sites instance. 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:
        this builder for use in a chained invocation
      • addMessage

        @CanIgnoreReturnValue
        public final ImmutableSites.Builder addMessage​(SiteVisitor.Message element)
        Adds one element to message list.
        Parameters:
        element - A message element
        Returns:
        this builder for use in a chained invocation
      • addMessage

        @CanIgnoreReturnValue
        public final ImmutableSites.Builder addMessage​(SiteVisitor.Message... elements)
        Adds elements to message list.
        Parameters:
        elements - An array of message elements
        Returns:
        this builder for use in a chained invocation
      • message

        @CanIgnoreReturnValue
        public final ImmutableSites.Builder message​(Iterable<? extends SiteVisitor.Message> elements)
        Sets or replaces all elements for message list.
        Parameters:
        elements - An iterable of message elements
        Returns:
        this builder for use in a chained invocation
      • addAllMessage

        @CanIgnoreReturnValue
        public final ImmutableSites.Builder addAllMessage​(Iterable<? extends SiteVisitor.Message> elements)
        Adds elements to message list.
        Parameters:
        elements - An iterable of message elements
        Returns:
        this builder for use in a chained invocation
      • addSites

        @CanIgnoreReturnValue
        public final ImmutableSites.Builder addSites​(SiteContent.Site element)
        Adds one element to sites list.
        Parameters:
        element - A sites element
        Returns:
        this builder for use in a chained invocation
      • addSites

        @CanIgnoreReturnValue
        public final ImmutableSites.Builder addSites​(SiteContent.Site... elements)
        Adds elements to sites list.
        Parameters:
        elements - An array of sites elements
        Returns:
        this builder for use in a chained invocation
      • sites

        @CanIgnoreReturnValue
        public final ImmutableSites.Builder sites​(Iterable<? extends SiteContent.Site> elements)
        Sets or replaces all elements for sites list.
        Parameters:
        elements - An iterable of sites elements
        Returns:
        this builder for use in a chained invocation
      • addAllSites

        @CanIgnoreReturnValue
        public final ImmutableSites.Builder addAllSites​(Iterable<? extends SiteContent.Site> elements)
        Adds elements to sites list.
        Parameters:
        elements - An iterable of sites elements
        Returns:
        this builder for use in a chained invocation