001/*
002 * (C) Copyright 2006 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * Licensed under the Apache License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 *     http://www.apache.org/licenses/LICENSE-2.0
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 *
016 * Contributors:
017 *     Florent Guillaume
018 */
019package org.nuxeo.project.sample;
020
021import java.io.Serializable;
022import java.util.ArrayList;
023import java.util.Collections;
024import java.util.List;
025
026public class BookWorkflowTask implements Serializable {
027
028    private static final long serialVersionUID = 1L;
029
030    protected List<String> actors;
031
032    protected String newTitle;
033
034    public BookWorkflowTask() {
035    }
036
037    public BookWorkflowTask(List<String> actors) {
038        this.actors = actors;
039    }
040
041    public BookWorkflowTask(String actor) {
042        actors = Collections.singletonList(actor);
043    }
044
045    public BookWorkflowTask(List<String> actors, String newTitle) {
046        this.actors = actors;
047        this.newTitle = newTitle;
048    }
049
050    public BookWorkflowTask(String actor, String newTitle) {
051        this.actors = Collections.singletonList(actor);
052        this.newTitle = newTitle;
053    }
054
055    public List<String> getActors() {
056        if (actors == null) {
057            actors = new ArrayList<String>();
058        }
059        return actors;
060    }
061
062    public void setActors(List<String> actors) {
063        this.actors = actors;
064    }
065
066    public String getDirective() {
067        return newTitle;
068    }
069
070    public void setDirective(String directive) {
071        this.newTitle = directive;
072    }
073
074}