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

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

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

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Namespace;
import org.simpleframework.xml.Root;

/**
 * Object representation of response XML of DeleteObjects
 * API.
 */
@Root(name = "DeleteResult", strict = false)
@Namespace(reference = "http://s3.amazonaws.com/doc/2006-03-01/")
public class DeleteResult {
  @ElementList(name = "Deleted", inline = true, required = false)
  private List objectList;

  @ElementList(name = "Error", inline = true, required = false)
  private List errorList;

  public DeleteResult() {}

  /** Constructs new delete result with an error. */
  public DeleteResult(DeleteError error) {
    this.errorList = new LinkedList();
    this.errorList.add(error);
  }

  /** Returns deleted object list. */
  public List objectList() {
    if (objectList == null) {
      return Collections.unmodifiableList(new LinkedList<>());
    }

    return Collections.unmodifiableList(objectList);
  }

  /** Returns delete error list. */
  public List errorList() {
    if (errorList == null) {
      return Collections.unmodifiableList(new LinkedList<>());
    }

    return Collections.unmodifiableList(errorList);
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy