package com.atlassian.stash.internal.task;

import com.atlassian.bitbucket.task.TaskOperations;

/**
 * A flyweight of the currently permitted combinations of task operations.
 *
 * @since 3.3
 */
public class InternalTaskOperations implements TaskOperations {

    public static final InternalTaskOperations ALL = new InternalTaskOperations(true, true, true);
    public static final InternalTaskOperations TRANSITION = new InternalTaskOperations(false, false, true);

    private final boolean deletable;
    private final boolean editable;
    private final boolean transitional;

    private InternalTaskOperations(boolean deletable, boolean editable, boolean transitional) {
        this.deletable = deletable;
        this.editable = editable;
        this.transitional = transitional;
    }

    @Override
    public boolean isDeletable() {
        return deletable;
    }

    @Override
    public boolean isEditable() {
        return editable;
    }

    @Override
    public boolean isTransitionable() {
        return transitional;
    }

}
