// Path: src/main/java/de/fesere/hypermedia/cj/exceptions/CollectionHasErrorsException.java
// public class CollectionHasErrorsException extends RuntimeException {
// 
//     public CollectionHasErrorsException(Error error) {
//         super(error.getTitle() + " (Code " + error.getCode() + ") : " + error.getMessage() + ".");
//     }
// 
// 
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/exceptions/ElementNotFoundException.java
// public class ElementNotFoundException extends RuntimeException {
//     public ElementNotFoundException(String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/serialization/Wrapped.java
// public interface Wrapped {
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/transformer/ReadTransformation.java
// public interface ReadTransformation<T> {
// 
//     T transform(Item item);
// }


import com.fasterxml.jackson.annotation.*;
import de.fesere.hypermedia.cj.exceptions.CollectionHasErrorsException;
import de.fesere.hypermedia.cj.exceptions.ElementNotFoundException;
import de.fesere.hypermedia.cj.serialization.Wrapped;
import de.fesere.hypermedia.cj.transformer.ReadTransformation;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.ANY;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;

    public URI getHref() {
        return this.href;
    }

    public List<Item> getItems() {
        throwExceptionOnError();

        return new ArrayList<>(items);
    }

    public List<Link> getLinks() {
        throwExceptionOnError();

        return new ArrayList<>(links);
    }

    private void throwExceptionOnError() {
        if(hasError()) {
            throw new CollectionHasErrorsException(getError());
        }
    }

    public List<Query> getQueries() {
        throwExceptionOnError();

        return new ArrayList<>(queries);
    }


// Path: src/main/java/de/fesere/hypermedia/cj/exceptions/CollectionHasErrorsException.java
// public class CollectionHasErrorsException extends RuntimeException {
// 
//     public CollectionHasErrorsException(Error error) {
//         super(error.getTitle() + " (Code " + error.getCode() + ") : " + error.getMessage() + ".");
//     }
// 
// 
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/exceptions/ElementNotFoundException.java
// public class ElementNotFoundException extends RuntimeException {
//     public ElementNotFoundException(String message) {
//         super(message);
//     }
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/serialization/Wrapped.java
// public interface Wrapped {
// }
// 
// Path: src/main/java/de/fesere/hypermedia/cj/transformer/ReadTransformation.java
// public interface ReadTransformation<T> {
// 
//     T transform(Item item);
// }


// Path: src/main/java/de/fesere/hypermedia/cj/model/Collection.java
import com.fasterxml.jackson.annotation.*;
import de.fesere.hypermedia.cj.exceptions.CollectionHasErrorsException;
import de.fesere.hypermedia.cj.exceptions.ElementNotFoundException;
import de.fesere.hypermedia.cj.serialization.Wrapped;
import de.fesere.hypermedia.cj.transformer.ReadTransformation;
import java.net.URI;
import java.util.ArrayList;
import java.util.List;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.ANY;
import static com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility.NONE;


    public URI getHref() {
        return this.href;
    }

    public List<Item> getItems() {
        throwExceptionOnError();

        return new ArrayList<>(items);
    }

    public List<Link> getLinks() {
        throwExceptionOnError();

        return new ArrayList<>(links);
    }

    private void throwExceptionOnError() {
        if(hasError()) {
            throw new CollectionHasErrorsException(getError());
        }
    }

    public List<Query> getQueries() {
        throwExceptionOnError();

        return new ArrayList<>(queries);
    }


    public <T> List<T> transform(ReadTransformation<T> transformer) {