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

com.enonic.xp.node.DeleteSnapshotParams Maven / Gradle / Ivy

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

import java.time.Instant;
import java.util.Collection;
import java.util.HashSet;
import java.util.Set;

import com.enonic.xp.annotation.PublicApi;

@PublicApi
public class DeleteSnapshotParams
{
    private final Set snapshotNames;

    private final Instant before;

    private DeleteSnapshotParams( Builder builder )
    {
        snapshotNames = builder.snapshotNames;
        before = builder.before;
    }

    public Set getSnapshotNames()
    {
        return snapshotNames;
    }

    public Instant getBefore()
    {
        return before;
    }

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

    public static final class Builder
    {
        private final Set snapshotNames = new HashSet<>();

        private Instant before;

        private Builder()
        {
        }

        public Builder add( final String snapshotName )
        {
            this.snapshotNames.add( snapshotName );
            return this;
        }

        public Builder addAll( final Collection snapshotNames )
        {
            this.snapshotNames.addAll( snapshotNames );
            return this;
        }


        public Builder before( Instant before )
        {
            this.before = before;
            return this;
        }

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy