Source:
public LifecycleRule( @Nonnull @Element(name = "Status") Status status, @Nullable @Element(name = "AbortIncompleteMultipartUpload", required = false) AbortIncompleteMultipartUpload abortIncompleteMultipartUpload, @Nullable @Element(name = "Expiration", required = false) Expiration expiration, @Nonnull @Element(name = "Filter", required = false) RuleFilter filter, @Nullable @Element(name = "ID", required = false) String id, @Nullable @Element(name = "NoncurrentVersionExpiration", required = false) NoncurrentVersionExpiration noncurrentVersionExpiration, @Nullable @Element(name = "NoncurrentVersionTransition", required = false) NoncurrentVersionTransition noncurrentVersionTransition, @Nullable @Element(name = "Transition", required = false) Transition transition) { if (abortIncompleteMultipartUpload == null && expiration == null && noncurrentVersionExpiration == null && noncurrentVersionTransition == null && transition == null) { throw new IllegalArgumentException( "At least one of action (AbortIncompleteMultipartUpload, Expiration, " + "NoncurrentVersionExpiration, NoncurrentVersionTransition or Transition) must to " + "be specified in a rule"); } if (id != null) { id = id.trim(); if (id.isEmpty()) throw new IllegalArgumentException("ID must be non-empty string"); if (id.length() > 255) throw new IllegalArgumentException("ID must be exceed 255 characters"); } this.abortIncompleteMultipartUpload = abortIncompleteMultipartUpload; this.expiration = expiration; this.filter = Objects.requireNonNull(filter, "Filter must not be null"); this.id = id; this.noncurrentVersionExpiration = noncurrentVersionExpiration; this.noncurrentVersionTransition = noncurrentVersionTransition; this.status = Objects.requireNonNull(status, "Status must not be null"); this.transition = transition; }

Target:
public LifecycleRule( @Nonnull @Element(name = "Status") Status status, @Nullable @Element(name = "AbortIncompleteMultipartUpload", required = false) AbortIncompleteMultipartUpload abortIncompleteMultipartUpload, @Nullable @Element(name = "Expiration", required = false) Expiration expiration, @Nonnull @Element(name = "Filter", required = false) RuleFilter filter, @Nullable @Element(name = "ID", required = false) String id, @Nullable @Element(name = "NoncurrentVersionExpiration", required = false) NoncurrentVersionExpiration noncurrentVersionExpiration, @Nullable @Element(name = "NoncurrentVersionTransition", required = false) NoncurrentVersionTransition noncurrentVersionTransition, @Nullable @Element(name = "Transition", required = false) Transition transition) { if (abortIncompleteMultipartUpload == null && expiration == null && noncurrentVersionExpiration == null && noncurrentVersionTransition == null && transition == null) { throw new IllegalArgumentException( "At least one of action (AbortIncompleteMultipartUpload, Expiration, " + "NoncurrentVersionExpiration, NoncurrentVersionTransition or Transition) must be " + "specified in a rule"); } if (id != null) { id = id.trim(); if (id.isEmpty()) throw new IllegalArgumentException("ID must be non-empty string"); if (id.length() > 255) throw new IllegalArgumentException("ID must be exceed 255 characters"); } this.abortIncompleteMultipartUpload = abortIncompleteMultipartUpload; this.expiration = expiration; this.filter = Objects.requireNonNull(filter, "Filter must not be null"); this.id = id; this.noncurrentVersionExpiration = noncurrentVersionExpiration; this.noncurrentVersionTransition = noncurrentVersionTransition; this.status = Objects.requireNonNull(status, "Status must not be null"); this.transition = transition; }