Class ImmutableLink.Builder

  • Enclosing class:
    ImmutableLink

    @NotThreadSafe
    public static final class ImmutableLink.Builder
    extends Object
    Builds instances of type ImmutableLink. 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 ImmutableLink.Builder from​(Link instance)
        Fill a builder with attribute values from the provided Link instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.
        Parameters:
        instance - The instance from which to copy values
        Returns:
        this builder for use in a chained invocation
      • url

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder url​(URI url)
        Initializes the value for the url attribute.
        Parameters:
        url - The value for url
        Returns:
        this builder for use in a chained invocation
      • rel

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder rel​(String rel)
        Initializes the optional value rel to rel.
        Parameters:
        rel - The value for rel
        Returns:
        this builder for chained invocation
      • rel

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder rel​(Optional<String> rel)
        Initializes the optional value rel to rel.
        Parameters:
        rel - The value for rel
        Returns:
        this builder for use in a chained invocation
      • rev

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder rev​(String rev)
        Initializes the optional value rev to rev.
        Parameters:
        rev - The value for rev
        Returns:
        this builder for chained invocation
      • rev

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder rev​(Optional<String> rev)
        Initializes the optional value rev to rev.
        Parameters:
        rev - The value for rev
        Returns:
        this builder for use in a chained invocation
      • type

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder type​(String type)
        Initializes the optional value type to type.
        Parameters:
        type - The value for type
        Returns:
        this builder for chained invocation
      • type

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder type​(Optional<String> type)
        Initializes the optional value type to type.
        Parameters:
        type - The value for type
        Returns:
        this builder for use in a chained invocation
      • media

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder media​(String media)
        Initializes the optional value media to media.
        Parameters:
        media - The value for media
        Returns:
        this builder for chained invocation
      • media

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder media​(Optional<String> media)
        Initializes the optional value media to media.
        Parameters:
        media - The value for media
        Returns:
        this builder for use in a chained invocation
      • title

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder title​(String title)
        Initializes the optional value title to title.
        Parameters:
        title - The value for title
        Returns:
        this builder for chained invocation
      • title

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder title​(Optional<String> title)
        Initializes the optional value title to title.
        Parameters:
        title - The value for title
        Returns:
        this builder for use in a chained invocation
      • anchor

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder anchor​(String anchor)
        Initializes the optional value anchor to anchor.
        Parameters:
        anchor - The value for anchor
        Returns:
        this builder for chained invocation
      • anchor

        @CanIgnoreReturnValue
        public final ImmutableLink.Builder anchor​(Optional<String> anchor)
        Initializes the optional value anchor to anchor.
        Parameters:
        anchor - The value for anchor
        Returns:
        this builder for use in a chained invocation