Package com.spotify.github.v3.hooks
Class ImmutableWebhook
- java.lang.Object
-
- com.spotify.github.v3.hooks.ImmutableWebhook
-
- All Implemented Interfaces:
UpdateTracking
,Webhook
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableWebhook extends Object implements Webhook
Immutable implementation ofWebhook
.Use the builder to create immutable instances:
ImmutableWebhook.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableWebhook.Builder
Builds instances of typeImmutableWebhook
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
active()
Determines whether the hook is actually triggered on pushes.static ImmutableWebhook.Builder
builder()
Creates a builder forImmutableWebhook
.WebhookConfig
config()
These settings vary between hooks and some are defined in the github-services repository.static ImmutableWebhook
copyOf(Webhook instance)
Creates an immutable copy of aWebhook
value.GitHubInstant
createdAt()
Created dateboolean
equals(Object another)
This instance is equal to all instances ofImmutableWebhook
that have equal attribute values.List<String>
events()
Determines what events the hook is triggered for.int
hashCode()
Computes a hash code from attributes:createdAt
,updatedAt
,id
,url
,testUrl
,pingUrl
,name
,events
,active
,config
.Integer
id()
IDString
name()
NameURI
pingUrl()
Ping URLURI
testUrl()
Test URLString
toString()
Prints the immutable valueWebhook
with attribute values.GitHubInstant
updatedAt()
Updated dateURI
url()
URLImmutableWebhook
withActive(Boolean value)
Copy the current immutable object by setting a value for theactive
attribute.ImmutableWebhook
withConfig(WebhookConfig value)
Copy the current immutable object by setting a value for theconfig
attribute.ImmutableWebhook
withCreatedAt(GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAt
attribute.ImmutableWebhook
withEvents(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofevents
.ImmutableWebhook
withEvents(String... elements)
Copy the current immutable object with elements that replace the content ofevents
.ImmutableWebhook
withId(Integer value)
Copy the current immutable object by setting a value for theid
attribute.ImmutableWebhook
withName(String value)
Copy the current immutable object by setting a value for thename
attribute.ImmutableWebhook
withPingUrl(URI value)
Copy the current immutable object by setting a value for thepingUrl
attribute.ImmutableWebhook
withTestUrl(URI value)
Copy the current immutable object by setting a value for thetestUrl
attribute.ImmutableWebhook
withUpdatedAt(GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAt
attribute.ImmutableWebhook
withUrl(URI value)
Copy the current immutable object by setting a value for theurl
attribute.
-
-
-
Method Detail
-
createdAt
@Nullable public GitHubInstant createdAt()
Created date- Specified by:
createdAt
in interfaceUpdateTracking
- Returns:
- The date when the issue was created
-
updatedAt
@Nullable public GitHubInstant updatedAt()
Updated date- Specified by:
updatedAt
in interfaceUpdateTracking
- Returns:
- The date when the issue was updated
-
events
@Nullable public List<String> events()
Determines what events the hook is triggered for. Default: ["push"]
-
active
@Nullable public Boolean active()
Determines whether the hook is actually triggered on pushes.
-
config
@Nullable public WebhookConfig config()
These settings vary between hooks and some are defined in the github-services repository.
-
withCreatedAt
public final ImmutableWebhook withCreatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for thecreatedAt
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for createdAt (can benull
)- Returns:
- A modified copy of the
this
object
-
withUpdatedAt
public final ImmutableWebhook withUpdatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAt
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for updatedAt (can benull
)- Returns:
- A modified copy of the
this
object
-
withId
public final ImmutableWebhook withId(@Nullable Integer value)
Copy the current immutable object by setting a value for theid
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for id (can benull
)- Returns:
- A modified copy of the
this
object
-
withUrl
public final ImmutableWebhook withUrl(@Nullable URI value)
Copy the current immutable object by setting a value for theurl
attribute. 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
this
object
-
withTestUrl
public final ImmutableWebhook withTestUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thetestUrl
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for testUrl (can benull
)- Returns:
- A modified copy of the
this
object
-
withPingUrl
public final ImmutableWebhook withPingUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thepingUrl
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for pingUrl (can benull
)- Returns:
- A modified copy of the
this
object
-
withName
public final ImmutableWebhook withName(@Nullable String value)
Copy the current immutable object by setting a value for thename
attribute. 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
this
object
-
withEvents
public final ImmutableWebhook withEvents(@Nullable String... elements)
Copy the current immutable object with elements that replace the content ofevents
.- Parameters:
elements
- The elements to set- Returns:
- A modified copy of
this
object
-
withEvents
public final ImmutableWebhook withEvents(@Nullable Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofevents
. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
elements
- An iterable of events elements to set- Returns:
- A modified copy of
this
object
-
withActive
public final ImmutableWebhook withActive(@Nullable Boolean value)
Copy the current immutable object by setting a value for theactive
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for active (can benull
)- Returns:
- A modified copy of the
this
object
-
withConfig
public final ImmutableWebhook withConfig(@Nullable WebhookConfig value)
Copy the current immutable object by setting a value for theconfig
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for config (can benull
)- Returns:
- A modified copy of the
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableWebhook
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:createdAt
,updatedAt
,id
,url
,testUrl
,pingUrl
,name
,events
,active
,config
.
-
toString
public String toString()
Prints the immutable valueWebhook
with attribute values.
-
copyOf
public static ImmutableWebhook copyOf(Webhook instance)
Creates an immutable copy of aWebhook
value. 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 Webhook instance
-
builder
public static ImmutableWebhook.Builder builder()
Creates a builder forImmutableWebhook
.ImmutableWebhook.builder() .createdAt(com.spotify.github.GitHubInstant | null) // nullable
createdAt
.updatedAt(com.spotify.github.GitHubInstant | null) // nullableupdatedAt
.id(Integer | null) // nullableid
.url(java.net.URI | null) // nullableurl
.testUrl(java.net.URI | null) // nullabletestUrl
.pingUrl(java.net.URI | null) // nullablepingUrl
.name(String | null) // nullablename
.events(List<String> | null) // nullableevents
.active(Boolean | null) // nullableactive
.config(com.spotify.github.v3.hooks.WebhookConfig | null) // nullableconfig
.build();- Returns:
- A new ImmutableWebhook builder
-
-