Class ImmutableHref<T>
- java.lang.Object
-
- com.spotify.github.v3.activity.events.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 ofReviewLinks.Href.Use the builder to create immutable instances:
ImmutableHref.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableHref.Builder<T>Builds instances of typeImmutableHref.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ImmutableHref.Builder<T>builder()Creates a builder forImmutableHref.static <T> ImmutableHref<T>copyOf(ReviewLinks.Href<T> instance)Creates an immutable copy of aReviewLinks.Hrefvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableHrefthat have equal attribute values.inthashCode()Computes a hash code from attributes:href.Thref()StringtoString()Prints the immutable valueHrefwith attribute values.ImmutableHref<T>withHref(T value)Copy the current immutable object by setting a value for thehrefattribute.
-
-
-
Method Detail
-
href
public T href()
- Specified by:
hrefin interfaceReviewLinks.Href<T>- Returns:
- The value of the
hrefattribute
-
withHref
public final ImmutableHref<T> withHref(T value)
Copy the current immutable object by setting a value for thehrefattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for href- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableHrefthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:href.
-
toString
public String toString()
Prints the immutable valueHrefwith attribute values.
-
copyOf
public static <T> ImmutableHref<T> copyOf(ReviewLinks.Href<T> instance)
Creates an immutable copy of aReviewLinks.Hrefvalue. 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 forImmutableHref.ImmutableHref.<T>builder() .href(T) // requiredhref.build();- Type Parameters:
T- generic parameter T- Returns:
- A new ImmutableHref builder
-
-