Package com.spotify.github.v3.checks
Class ImmutableApp
- java.lang.Object
-
- com.spotify.github.v3.checks.ImmutableApp
-
- All Implemented Interfaces:
App
@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableApp extends Object implements App
Immutable implementation ofApp
.Use the builder to create immutable instances:
ImmutableApp.builder()
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImmutableApp.Builder
Builds instances of typeImmutableApp
.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ImmutableApp.Builder
builder()
Creates a builder forImmutableApp
.static ImmutableApp
copyOf(App instance)
Creates an immutable copy of aApp
value.ZonedDateTime
createdAt()
The date the App was created.String
description()
The App Description.boolean
equals(Object another)
This instance is equal to all instances ofImmutableApp
that have equal attribute values.List<String>
events()
Events list this App will consume, such as push, pull_request, etc.String
externalUrl()
External url string.int
hashCode()
Computes a hash code from attributes:id
,slug
,name
,description
,externalUrl
,htmlUrl
,createdAt
,updatedAt
,permissions
,events
,installationsCount
.String
htmlUrl()
Html url string.Integer
id()
The App ID.Optional<Integer>
installationsCount()
Installation count of the App.String
name()
The App nameMap<String,String>
permissions()
The permissions the installation of the app has.Optional<String>
slug()
The URL-friendly name of the GitHub App.String
toString()
Prints the immutable valueApp
with attribute values.ZonedDateTime
updatedAt()
The date the App was updated.ImmutableApp
withCreatedAt(ZonedDateTime value)
Copy the current immutable object by setting a value for thecreatedAt
attribute.ImmutableApp
withDescription(String value)
Copy the current immutable object by setting a value for thedescription
attribute.ImmutableApp
withEvents(Iterable<String> elements)
Copy the current immutable object with elements that replace the content ofevents
.ImmutableApp
withEvents(String... elements)
Copy the current immutable object with elements that replace the content ofevents
.ImmutableApp
withExternalUrl(String value)
Copy the current immutable object by setting a value for theexternalUrl
attribute.ImmutableApp
withHtmlUrl(String value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute.ImmutableApp
withId(Integer value)
Copy the current immutable object by setting a value for theid
attribute.ImmutableApp
withInstallationsCount(int value)
Copy the current immutable object by setting a present value for the optionalinstallationsCount
attribute.ImmutableApp
withInstallationsCount(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for theinstallationsCount
attribute.ImmutableApp
withName(String value)
Copy the current immutable object by setting a value for thename
attribute.ImmutableApp
withPermissions(Map<String,? extends String> entries)
Copy the current immutable object by replacing thepermissions
map with the specified map.ImmutableApp
withSlug(String value)
Copy the current immutable object by setting a present value for the optionalslug
attribute.ImmutableApp
withSlug(Optional<String> optional)
Copy the current immutable object by setting an optional value for theslug
attribute.ImmutableApp
withUpdatedAt(ZonedDateTime value)
Copy the current immutable object by setting a value for theupdatedAt
attribute.
-
-
-
Method Detail
-
description
public String description()
The App Description.- Specified by:
description
in interfaceApp
- Returns:
- the string
-
externalUrl
public String externalUrl()
External url string.- Specified by:
externalUrl
in interfaceApp
- Returns:
- the string
-
htmlUrl
public String htmlUrl()
Html url string.
-
createdAt
public ZonedDateTime createdAt()
The date the App was created.
-
updatedAt
public ZonedDateTime updatedAt()
The date the App was updated.
-
permissions
public Map<String,String> permissions()
The permissions the installation of the app has.- Specified by:
permissions
in interfaceApp
- Returns:
- the map with permissions
- See Also:
- "https://developer.github.com/apps/building-github-apps/creating-github-apps-using-url -parameters/#github-app-permissions"
-
events
public List<String> events()
Events list this App will consume, such as push, pull_request, etc.
-
installationsCount
public Optional<Integer> installationsCount()
Installation count of the App.- Specified by:
installationsCount
in interfaceApp
- Returns:
- the optional count
-
withId
public final ImmutableApp withId(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- Returns:
- A modified copy of the
this
object
-
withSlug
public final ImmutableApp withSlug(String value)
Copy the current immutable object by setting a present value for the optionalslug
attribute.- Parameters:
value
- The value for slug- Returns:
- A modified copy of
this
object
-
withSlug
public final ImmutableApp withSlug(Optional<String> optional)
Copy the current immutable object by setting an optional value for theslug
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for slug- Returns:
- A modified copy of
this
object
-
withName
public final ImmutableApp withName(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- Returns:
- A modified copy of the
this
object
-
withDescription
public final ImmutableApp withDescription(String value)
Copy the current immutable object by setting a value for thedescription
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for description- Returns:
- A modified copy of the
this
object
-
withExternalUrl
public final ImmutableApp withExternalUrl(String value)
Copy the current immutable object by setting a value for theexternalUrl
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for externalUrl- Returns:
- A modified copy of the
this
object
-
withHtmlUrl
public final ImmutableApp withHtmlUrl(String value)
Copy the current immutable object by setting a value for thehtmlUrl
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for htmlUrl- Returns:
- A modified copy of the
this
object
-
withCreatedAt
public final ImmutableApp withCreatedAt(ZonedDateTime 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- Returns:
- A modified copy of the
this
object
-
withUpdatedAt
public final ImmutableApp withUpdatedAt(ZonedDateTime 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- Returns:
- A modified copy of the
this
object
-
withPermissions
public final ImmutableApp withPermissions(Map<String,? extends String> entries)
Copy the current immutable object by replacing thepermissions
map with the specified map. Nulls are not permitted as keys or values. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
entries
- The entries to be added to the permissions map- Returns:
- A modified copy of
this
object
-
withEvents
public final ImmutableApp withEvents(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 ImmutableApp withEvents(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
-
withInstallationsCount
public final ImmutableApp withInstallationsCount(int value)
Copy the current immutable object by setting a present value for the optionalinstallationsCount
attribute.- Parameters:
value
- The value for installationsCount- Returns:
- A modified copy of
this
object
-
withInstallationsCount
public final ImmutableApp withInstallationsCount(Optional<Integer> optional)
Copy the current immutable object by setting an optional value for theinstallationsCount
attribute. An equality check is used on inner nullable value to prevent copying of the same value by returningthis
.- Parameters:
optional
- A value for installationsCount- Returns:
- A modified copy of
this
object
-
equals
public boolean equals(@Nullable Object another)
This instance is equal to all instances ofImmutableApp
that have equal attribute values.
-
hashCode
public int hashCode()
Computes a hash code from attributes:id
,slug
,name
,description
,externalUrl
,htmlUrl
,createdAt
,updatedAt
,permissions
,events
,installationsCount
.
-
toString
public String toString()
Prints the immutable valueApp
with attribute values.
-
copyOf
public static ImmutableApp copyOf(App instance)
Creates an immutable copy of aApp
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 App instance
-
builder
public static ImmutableApp.Builder builder()
Creates a builder forImmutableApp
.ImmutableApp.builder() .id(Integer) // required
id
.slug(String) // optionalslug
.name(String) // requiredname
.description(String) // requireddescription
.externalUrl(String) // requiredexternalUrl
.htmlUrl(String) // requiredhtmlUrl
.createdAt(java.time.ZonedDateTime) // requiredcreatedAt
.updatedAt(java.time.ZonedDateTime) // requiredupdatedAt
.putPermissions|putAllPermissions(String => String) //permissions
mappings .addEvents|addAllEvents(String) //events
elements .installationsCount(Integer) // optionalinstallationsCount
.build();- Returns:
- A new ImmutableApp builder
-
-