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 classImmutableWebhook.BuilderBuilds instances of typeImmutableWebhook.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Booleanactive()Determines whether the hook is actually triggered on pushes.static ImmutableWebhook.Builderbuilder()Creates a builder forImmutableWebhook.WebhookConfigconfig()These settings vary between hooks and some are defined in the github-services repository.static ImmutableWebhookcopyOf(Webhook instance)Creates an immutable copy of aWebhookvalue.GitHubInstantcreatedAt()Created datebooleanequals(Object another)This instance is equal to all instances ofImmutableWebhookthat have equal attribute values.List<String>events()Determines what events the hook is triggered for.inthashCode()Computes a hash code from attributes:createdAt,updatedAt,id,url,testUrl,pingUrl,name,events,active,config.Integerid()IDStringname()NameURIpingUrl()Ping URLURItestUrl()Test URLStringtoString()Prints the immutable valueWebhookwith attribute values.GitHubInstantupdatedAt()Updated dateURIurl()URLImmutableWebhookwithActive(Boolean value)Copy the current immutable object by setting a value for theactiveattribute.ImmutableWebhookwithConfig(WebhookConfig value)Copy the current immutable object by setting a value for theconfigattribute.ImmutableWebhookwithCreatedAt(GitHubInstant value)Copy the current immutable object by setting a value for thecreatedAtattribute.ImmutableWebhookwithEvents(Iterable<String> elements)Copy the current immutable object with elements that replace the content ofevents.ImmutableWebhookwithEvents(String... elements)Copy the current immutable object with elements that replace the content ofevents.ImmutableWebhookwithId(Integer value)Copy the current immutable object by setting a value for theidattribute.ImmutableWebhookwithName(String value)Copy the current immutable object by setting a value for thenameattribute.ImmutableWebhookwithPingUrl(URI value)Copy the current immutable object by setting a value for thepingUrlattribute.ImmutableWebhookwithTestUrl(URI value)Copy the current immutable object by setting a value for thetestUrlattribute.ImmutableWebhookwithUpdatedAt(GitHubInstant value)Copy the current immutable object by setting a value for theupdatedAtattribute.ImmutableWebhookwithUrl(URI value)Copy the current immutable object by setting a value for theurlattribute.
-
-
-
Method Detail
-
createdAt
@Nullable public GitHubInstant createdAt()
Created date- Specified by:
createdAtin interfaceUpdateTracking- Returns:
- The date when the issue was created
-
updatedAt
@Nullable public GitHubInstant updatedAt()
Updated date- Specified by:
updatedAtin 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 thecreatedAtattribute. 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
thisobject
-
withUpdatedAt
public final ImmutableWebhook withUpdatedAt(@Nullable GitHubInstant value)
Copy the current immutable object by setting a value for theupdatedAtattribute. 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
thisobject
-
withId
public final ImmutableWebhook withId(@Nullable Integer value)
Copy the current immutable object by setting a value for theidattribute. 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
thisobject
-
withUrl
public final ImmutableWebhook 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
-
withTestUrl
public final ImmutableWebhook withTestUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thetestUrlattribute. 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
thisobject
-
withPingUrl
public final ImmutableWebhook withPingUrl(@Nullable URI value)
Copy the current immutable object by setting a value for thepingUrlattribute. 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
thisobject
-
withName
public final ImmutableWebhook 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
-
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
thisobject
-
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
thisobject
-
withActive
public final ImmutableWebhook withActive(@Nullable Boolean value)
Copy the current immutable object by setting a value for theactiveattribute. 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
thisobject
-
withConfig
public final ImmutableWebhook withConfig(@Nullable WebhookConfig value)
Copy the current immutable object by setting a value for theconfigattribute. 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
thisobject
-
equals
public boolean equals(@Nullable Object another)This instance is equal to all instances ofImmutableWebhookthat 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 valueWebhookwith attribute values.
-
copyOf
public static ImmutableWebhook copyOf(Webhook instance)
Creates an immutable copy of aWebhookvalue. 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) // nullablecreatedAt.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
-
-