Package com.spotify.github
Class ImmutableHref<T>
- java.lang.Object
-
- com.spotify.github.ImmutableHref<T>
-
- All Implemented Interfaces:
Links.Href<T>
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableHref<T> extends Object implements Links.Href<T>
Immutable implementation ofLinks.Href
.Use the builder to create immutable instances:
ImmutableHref.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableHref.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(Links.Href<T> instance)
Creates an immutable copy of aLinks.Href
value.boolean
equals(Object another)
This instance is equal to all instances ofImmutableHref
that have equal attribute values.int
hashCode()
Computes a hash code from attributes:href
.T
href()
String
toString()
Prints the immutable valueHref
with attribute values.ImmutableHref<T>
withHref(T value)
Copy the current immutable object by setting a value for thehref
attribute.
-
-
-
Method Detail
-
href
public T href()
- Specified by:
href
in interfaceLinks.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 thehref
attribute. 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
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableHref
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:href
.
-
toString
public String toString()
Prints the immutable valueHref
with attribute values.
-
copyOf
public static <T> ImmutableHref<T> copyOf(Links.Href<T> instance)
Creates an immutable copy of aLinks.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 forImmutableHref
.ImmutableHref.<T>builder() .href(T) // required
href
.build();- Type Parameters:
T
- generic parameter T- Returns:
- A new ImmutableHref builder
-
-