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

com.enonic.xp.content.GetActiveContentVersionParams Maven / Gradle / Ivy

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

import com.google.common.base.Preconditions;

import com.enonic.xp.branch.Branch;

public final class GetActiveContentVersionParams
{
    private final ContentId contentId;

    private final Branch branch;

    private GetActiveContentVersionParams( final Builder builder )
    {
        this.contentId = builder.contentId;
        this.branch = builder.branch;
    }

    public ContentId getContentId()
    {
        return contentId;
    }

    public Branch getBranch()
    {
        return branch;
    }

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

    public static final class Builder
    {

        private ContentId contentId;

        private Branch branch;

        public Builder contentId( final ContentId contentId )
        {
            this.contentId = contentId;
            return this;
        }

        @Deprecated
        public Builder branch( final Branch branch )
        {
            this.branch = branch;
            return this;
        }

        public GetActiveContentVersionParams build()
        {
            Preconditions.checkNotNull( this.contentId, "Content id cannot be null" );
            return new GetActiveContentVersionParams( this );
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy