public BucketReplicationConfiguration withRules(
            Map<String, ReplicationRule> rules) {
        setRules(rules);
        return this;
    }
Sets the replication rules for the Amazon S3 bucket. Returns the updated
object.

@param rules
           the replication rules for the Amazon S3 bucket.
@throws IllegalArgumentException
            if the rules are null.
@return the updated {@link BucketReplicationConfiguration} object.
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/BucketReplicationConfiguration.java