Package com.spotify.github.v3.issues
Class ImmutableLabel
- java.lang.Object
-
- com.spotify.github.v3.issues.ImmutableLabel
-
- All Implemented Interfaces:
Label
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableLabel extends Object implements Label
Immutable implementation ofLabel.Use the builder to create immutable instances:
ImmutableLabel.builder().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classImmutableLabel.BuilderBuilds instances of typeImmutableLabel.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableLabel.Builderbuilder()Creates a builder forImmutableLabel.Stringcolor()Colorstatic ImmutableLabelcopyOf(Label instance)Creates an immutable copy of aLabelvalue.booleanequals(Object another)This instance is equal to all instances ofImmutableLabelthat have equal attribute values.inthashCode()Computes a hash code from attributes:url,name,color.Stringname()NameStringtoString()Prints the immutable valueLabelwith attribute values.URIurl()URLImmutableLabelwithColor(String value)Copy the current immutable object by setting a value for thecolorattribute.ImmutableLabelwithName(String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableLabelwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
Method Detail
-
withUrl
public final ImmutableLabel withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurlattribute. A shallow reference equality check is used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for url (can benull)- Returns:
- A modified copy of the
thisobject
-
withName
public final ImmutableLabel withName(@Nullable String value)
Copy the current immutable object by setting a value for thenameattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for name (can benull)- Returns:
- A modified copy of the
thisobject
-
withColor
public final ImmutableLabel withColor(@Nullable String value)
Copy the current immutable object by setting a value for thecolorattribute. An equals check used to prevent copying of the same value by returningthis.- Parameters:
value- A new value for color (can benull)- Returns:
- A modified copy of the
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableLabelthat have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:url,name,color.
-
toString
public String toString()
Prints the immutable valueLabelwith attribute values.
-
copyOf
public static ImmutableLabel copyOf(Label instance)
Creates an immutable copy of aLabelvalue. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance- The instance to copy- Returns:
- A copied immutable Label instance
-
builder
public static ImmutableLabel.Builder builder()
Creates a builder forImmutableLabel.ImmutableLabel.builder() .url(java.net.URI | null) // nullableurl.name(String | null) // nullablename.color(String | null) // nullablecolor.build();- Returns:
- A new ImmutableLabel builder
-
-