public void setRules(Map<String, ReplicationRule> rules) {
        if (rules == null) {
            throw new IllegalArgumentException(
                    "Replication rules cannot be null");
        }
        this.rules = new HashMap<String, ReplicationRule>(rules);
    }
Sets the replication rules for the Amazon S3 bucket.

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