All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.ionoscloud.s3.messages.LifecycleConfiguration Maven / Gradle / Ivy

The newest version!
package com.ionoscloud.s3.messages;

import java.util.Collections;
import java.util.List;
import java.util.Objects;
import javax.annotation.Nonnull;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Namespace;
import org.simpleframework.xml.Root;

/**
 * Object representation of request XML of PutBucketLifecycleConfiguration
 * API and response XML of GetBucketLifecycleConfiguration
 * API.
 */
@Root(name = "LifecycleConfiguration")
@Namespace(reference = "http://s3.amazonaws.com/doc/2006-03-01/")
public class LifecycleConfiguration {
  @ElementList(name = "Rule", inline = true)
  private List rules;

  /** Constructs new lifecycle configuration. */
  public LifecycleConfiguration(
      @Nonnull @ElementList(name = "Rule", inline = true) List rules) {
    this.rules =
        Collections.unmodifiableList(Objects.requireNonNull(rules, "Rules must not be null"));
    if (rules.isEmpty()) {
      throw new IllegalArgumentException("Rules must not be empty");
    }
  }

  public List rules() {
    return rules;
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy