// Path: src/main/java/de/jeha/s3srv/xml/InstantXmlAdapter.java
// public class InstantXmlAdapter extends XmlAdapter<String, Instant> {
// 
//     private final DateTimeFormatter formatter = DateTimeFormatter.ISO_INSTANT;
// 
//     @Override
//     public Instant unmarshal(String value) throws Exception {
//         return value != null ? formatter.parse(value, Instant::from) : null;
//     }
// 
//     @Override
//     public String marshal(Instant value) throws Exception {
//         return value != null ? formatter.format(value) : null;
//     }
// 
// }


import de.jeha.s3srv.xml.InstantXmlAdapter;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
package de.jeha.s3srv.api;



/**
 * @author jenshadlich@googlemail.com
 */
@XmlRootElement(name = "ListAllMyBucketsResult")
public class ListAllMyBucketsResult {

    @XmlElement(name = "Owner")
    private Owner owner;

    @XmlElementWrapper(name = "Buckets")
    @XmlElement(name = "Bucket")
    private List<BucketsEntry> buckets = new ArrayList<>();

    public ListAllMyBucketsResult() {
    }

    public ListAllMyBucketsResult(Owner owner, List<BucketsEntry> entries) {
        this.owner = owner;
        buckets.addAll(entries);
    }

    public Owner getOwner() {
        return owner;
    }

    public List<BucketsEntry> getBuckets() {
        return buckets;
    }

    public static class BucketsEntry {

        @XmlElement(name = "Name")
        private String name;

// Path: src/main/java/de/jeha/s3srv/xml/InstantXmlAdapter.java
// public class InstantXmlAdapter extends XmlAdapter<String, Instant> {
// 
//     private final DateTimeFormatter formatter = DateTimeFormatter.ISO_INSTANT;
// 
//     @Override
//     public Instant unmarshal(String value) throws Exception {
//         return value != null ? formatter.parse(value, Instant::from) : null;
//     }
// 
//     @Override
//     public String marshal(Instant value) throws Exception {
//         return value != null ? formatter.format(value) : null;
//     }
// 
// }


// Path: src/main/java/de/jeha/s3srv/api/ListAllMyBucketsResult.java
import de.jeha.s3srv.xml.InstantXmlAdapter;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;

package de.jeha.s3srv.api;



/**
 * @author jenshadlich@googlemail.com
 */
@XmlRootElement(name = "ListAllMyBucketsResult")
public class ListAllMyBucketsResult {

    @XmlElement(name = "Owner")
    private Owner owner;

    @XmlElementWrapper(name = "Buckets")
    @XmlElement(name = "Bucket")
    private List<BucketsEntry> buckets = new ArrayList<>();

    public ListAllMyBucketsResult() {
    }

    public ListAllMyBucketsResult(Owner owner, List<BucketsEntry> entries) {
        this.owner = owner;
        buckets.addAll(entries);
    }

    public Owner getOwner() {
        return owner;
    }

    public List<BucketsEntry> getBuckets() {
        return buckets;
    }

    public static class BucketsEntry {

        @XmlElement(name = "Name")
        private String name;

        @XmlJavaTypeAdapter(InstantXmlAdapter.class)