Record Class WebhookPayload
java.lang.Object
java.lang.Record
io.jenkins.plugins.webhookexternalstore.WebhookPayload
public record WebhookPayload(String id, String description, String type, Map<String,Object> secret)
extends Record
Represents the JSON payload received via webhook for credential creation/update.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.static WebhookPayloadfromJSON(net.sf.json.JSONObject json) Create a WebhookPayload from a JSONObject.getId()getSecretValue(String key) Return a secret value field from the secret map.getType()final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.secret()Returns the value of thesecretrecord component.toString()Returns a string representation of this record class.type()Returns the value of thetyperecord component.
-
Constructor Details
-
WebhookPayload
Constructor for WebhookPayload.- Parameters:
id- ID of the credentialdescription- Description of the credentialtype- Type of the credentialsecret- Map containing secret fields
-
-
Method Details
-
fromJSON
public static WebhookPayload fromJSON(net.sf.json.JSONObject json) throws CredentialsConvertionException Create a WebhookPayload from a JSONObject.- Parameters:
json- the JSON object- Returns:
- the webhook payload
- Throws:
CredentialsConvertionException- if required fields are missing
-
getId
-
getDescription
-
getType
-
getSecretValue
Return a secret value field from the secret map.- Parameters:
key- the key to look up in the secret map- Returns:
- the secret value as a String, or null if not found or not a String
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
type
Returns the value of thetyperecord component.- Returns:
- the value of the
typerecord component
-
secret
Returns the value of thesecretrecord component.- Returns:
- the value of the
secretrecord component
-