001/*
002 * (C) Copyright 2018 Nuxeo (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 *     Funsho David
018 */
019
020package org.nuxeo.ecm.platform.comment.api;
021
022import org.nuxeo.ecm.core.api.DocumentModel;
023
024import java.time.Instant;
025import java.util.Collection;
026
027/**
028 * Comment interface.
029 *
030 * @since 10.3
031 */
032public interface Comment {
033
034    /**
035     * Gets comment id.
036     *
037     * @return the id
038     */
039    String getId();
040
041    /**
042     * Sets comment id.
043     *
044     * @param id the id
045     * @deprecated since 11.1, you should use document adapter factory instead
046     */
047    @Deprecated(since = "11.1")
048    void setId(String id);
049
050    /**
051     * Gets parent id.
052     *
053     * @return the parent id
054     */
055    String getParentId();
056
057    /**
058     * Sets parent id.
059     *
060     * @param parentId the parent id
061     */
062    void setParentId(String parentId);
063
064    /**
065     * Gets the list of ancestor ids.
066     *
067     * @return the list of ancestor ids
068     */
069    Collection<String> getAncestorIds();
070
071    /**
072     * Adds an ancestor id.
073     *
074     * @param ancestorId the ancestor id
075     * @deprecated since 11.1, should be filled by document adapater factory
076     */
077    @Deprecated(since = "11.1")
078    void addAncestorId(String ancestorId);
079
080    /**
081     * Gets comment author.
082     *
083     * @return the author
084     */
085    String getAuthor();
086
087    /**
088     * Sets comment author.
089     *
090     * @param author the author
091     */
092    void setAuthor(String author);
093
094    /**
095     * Gets comment text.
096     *
097     * @return the text
098     */
099    String getText();
100
101    /**
102     * Sets comment text.
103     *
104     * @param text the text
105     */
106    void setText(String text);
107
108    /**
109     * Gets comment creation date.
110     *
111     * @return the creation date
112     */
113    Instant getCreationDate();
114
115    /**
116     * Sets comment creation date.
117     *
118     * @param creationDate the creation date
119     */
120    void setCreationDate(Instant creationDate);
121
122    /**
123     * Sets comment modification date.
124     *
125     * @return the modification date
126     */
127    Instant getModificationDate();
128
129    /**
130     * Sets comment modification date.
131     *
132     * @param modificationDate the modification date
133     */
134    void setModificationDate(Instant modificationDate);
135
136    /**
137     * Gets the document model backing this pojo.
138     *
139     * @return the document model backing this pojo
140     * @apiNote the returned document is detached
141     */
142    DocumentModel getDocument();
143}