Class ImmutableHref<T>

  • All Implemented Interfaces:
    ReviewLinks.Href<T>

    @ParametersAreNonnullByDefault
    @Generated("org.immutables.processor.ProxyProcessor")
    @Immutable
    @CheckReturnValue
    public final class ImmutableHref<T>
    extends Object
    implements ReviewLinks.Href<T>
    Immutable implementation of ReviewLinks.Href.

    Use the builder to create immutable instances: ImmutableHref.builder().

    • Method Detail

      • href

        public T href()
        Specified by:
        href in interface ReviewLinks.Href<T>
        Returns:
        The value of the href attribute
      • withHref

        public final ImmutableHref<T> withHref​(T value)
        Copy the current immutable object by setting a value for the href attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
        Parameters:
        value - A new value for href
        Returns:
        A modified copy of the this object
      • equals

        public boolean equals​(@Nullable
                              Object another)
        This instance is equal to all instances of ImmutableHref that have equal attribute values.
        Overrides:
        equals in class Object
        Returns:
        true if this is equal to another instance
      • hashCode

        public int hashCode()
        Computes a hash code from attributes: href.
        Overrides:
        hashCode in class Object
        Returns:
        hashCode value
      • toString

        public String toString()
        Prints the immutable value Href with attribute values.
        Overrides:
        toString in class Object
        Returns:
        A string representation of the value
      • copyOf

        public static <T> ImmutableHref<T> copyOf​(ReviewLinks.Href<T> instance)
        Creates an immutable copy of a ReviewLinks.Href value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.
        Type Parameters:
        T - generic parameter T
        Parameters:
        instance - The instance to copy
        Returns:
        A copied immutable Href instance
      • builder

        public static <T> ImmutableHref.Builder<T> builder()
        Creates a builder for ImmutableHref.
         ImmutableHref.&lt;T&gt;builder()
            .href(T) // required href
            .build();
         
        Type Parameters:
        T - generic parameter T
        Returns:
        A new ImmutableHref builder