Skip to content

Using a collection builder with ImmutableSortedSet #666

Description

@jonfreedman

I want to have a class similar to the below but ImmutableSortedSet.Builder throws an exception from it's factory method. Is this possible?

public abstract static class Builder {
    private static Builder builder() {
        return new AutoValue_Object.Builder();
    }

    abstract ImmutableSortedSet.Builder<ComparableObject> pointsBuilder();

    public abstract Builder setPoints(final ImmutableList<ComparableObject> points);

    public Builder addPoint(final ComparableObject point) {
        pointsBuilder().add(point);
        return this;
    }
    
    public abstract Object build();
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions