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

com.enonic.xp.archive.ArchiveContentsResult Maven / Gradle / Ivy

There is a newer version: 7.14.4
Show newest version
package com.enonic.xp.archive;

import com.enonic.xp.annotation.PublicApi;
import com.enonic.xp.content.ContentId;
import com.enonic.xp.content.ContentIds;

@PublicApi
public final class ArchiveContentsResult
{
    private final ContentIds archivedContents;

    private final ContentIds unpublishedContents;

    private ArchiveContentsResult( Builder builder )
    {
        this.archivedContents = builder.archivedContents.build();
        this.unpublishedContents = builder.unpublishedContents.build();
    }

    public static Builder create()
    {
        return new Builder();
    }

    public ContentIds getArchivedContents()
    {
        return archivedContents;
    }

    public ContentIds getUnpublishedContents()
    {
        return unpublishedContents;
    }

    public static final class Builder
    {
        private final ContentIds.Builder archivedContents = ContentIds.create();

        private final ContentIds.Builder unpublishedContents = ContentIds.create();

        private Builder()
        {
        }

        public Builder addArchived( final ContentId contentId )
        {
            this.archivedContents.add( contentId );
            return this;
        }

        public Builder addArchived( final ContentIds archivedContents )
        {
            this.archivedContents.addAll( archivedContents );
            return this;
        }

        public Builder addUnpublished( final ContentIds unpublishedContents )
        {
            this.unpublishedContents.addAll( unpublishedContents );
            return this;
        }

        public ArchiveContentsResult build()
        {
            return new ArchiveContentsResult( this );
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy