Class S3EventNotification
- java.lang.Object
-
- software.amazon.awssdk.eventnotifications.s3.model.S3EventNotification
-
public class S3EventNotification extends Object
A helper class that represents a strongly typed S3 Event Notification item sent to SQS, SNS, or Lambda. For more information about Amazon S3 Event Notifications, visit the S3 User Guide. This class can be used to parse notification messages in the json format or to serialize a S3EventNotification instance to json.
-
-
Constructor Summary
Constructors Constructor Description S3EventNotification(List<S3EventNotificationRecord> records)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
static S3EventNotification
fromJson(byte[] json)
Converts a json representation of the notification message to an instance of S3EventNotification.S3EventNotification
fromJson(InputStream json)
Converts a json representation of the notification message to an instance of S3EventNotification.static S3EventNotification
fromJson(String json)
Converts a json representation of the notification message to an instance of S3EventNotification.List<S3EventNotificationRecord>
getRecords()
int
hashCode()
String
toJson()
Serialize this instance to json format.String
toJsonPretty()
Serialize this instance to json format, with new line and correct indentation levels.String
toString()
-
-
-
Constructor Detail
-
S3EventNotification
public S3EventNotification(List<S3EventNotificationRecord> records)
-
-
Method Detail
-
getRecords
public List<S3EventNotificationRecord> getRecords()
-
fromJson
public static S3EventNotification fromJson(String json)
Converts a json representation of the notification message to an instance of S3EventNotification. Any missing fields of the json will be null in the resulting object. Any extra fields will be ignored.- Parameters:
json
- the notification message in json format- Returns:
- an instance of notification message S3EventNotification
-
fromJson
public static S3EventNotification fromJson(byte[] json)
Converts a json representation of the notification message to an instance of S3EventNotification. Any missing fields of the json will be null in the resulting object. Any extra fields will be ignored.- Parameters:
json
- the notification message in json format- Returns:
- an instance of notification message S3EventNotification
-
fromJson
public S3EventNotification fromJson(InputStream json)
Converts a json representation of the notification message to an instance of S3EventNotification. Any missing fields of the json will be null in the resulting object. Any extra fields will be ignored.- Parameters:
json
- the notification message in json format- Returns:
- an instance of notification message S3EventNotification
-
toJson
public String toJson()
Serialize this instance to json format.GlacierEventData
,ReplicationEventData
,IntelligentTieringEventData
andLifecycleEventData
keys will be excluded from the json ifnull
. Any other null fields of the object will be serialized as jsonnull
.- Returns:
- the json representation of this class.
-
toJsonPretty
public String toJsonPretty()
Serialize this instance to json format, with new line and correct indentation levels.GlacierEventData
,ReplicationEventData
,IntelligentTieringEventData
andLifecycleEventData
keys will be excluded from the json ifnull
. Any other null fields of the object will be serialized as jsonnull
.- Returns:
- the json representation of this class.
-
-