001/*
002 * Licensed to the Apache Software Foundation (ASF) under one
003 * or more contributor license agreements.  See the NOTICE file
004 * distributed with this work for additional information
005 * regarding copyright ownership.  The ASF licenses this file
006 * to you under the Apache License, Version 2.0 (the
007 * "License"); you may not use this file except in compliance
008 * with the License.  You may obtain a copy of the License at
009 *
010 *   http://www.apache.org/licenses/LICENSE-2.0
011 *
012 * Unless required by applicable law or agreed to in writing,
013 * software distributed under the License is distributed on an
014 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015 * KIND, either express or implied.  See the License for the
016 * specific language governing permissions and limitations
017 * under the License.
018 */
019package org.apache.maven.scm.command.info;
020
021import java.time.OffsetDateTime;
022import java.time.temporal.TemporalAccessor;
023
024/**
025 * Encapsulates meta information about a file (or directory) being managed with an SCM.
026 *
027 * For historical reasons the field/method names are inspired from (and sometimes only applicable to) the <a href="https://svnbook.red-bean.com/">Subversion SCM</a>.
028 *
029 * @author <a href="mailto:kenney@apache.org">Kenney Westerhof</a>
030 * @author Olivier Lamy
031 *
032 * @since 1.5
033 */
034public class InfoItem {
035    private String path;
036
037    private String url;
038
039    private String repositoryRoot;
040
041    private String repositoryUUID;
042
043    private String revision;
044
045    private String nodeKind;
046
047    private String schedule;
048
049    private String lastChangedAuthor;
050
051    private String lastChangedRevision;
052
053    private String lastChangedDate;
054
055    private OffsetDateTime lastChangedDateTime;
056
057    public String getPath() {
058        return path;
059    }
060
061    public void setPath(String path) {
062        this.path = path;
063    }
064
065    public String getURL() {
066        return url;
067    }
068
069    public void setURL(String url) {
070        this.url = url;
071    }
072
073    public String getRepositoryRoot() {
074        return repositoryRoot;
075    }
076
077    public void setRepositoryRoot(String repositoryRoot) {
078        this.repositoryRoot = repositoryRoot;
079    }
080
081    public String getRepositoryUUID() {
082        return repositoryUUID;
083    }
084
085    public void setRepositoryUUID(String repositoryUUID) {
086        this.repositoryUUID = repositoryUUID;
087    }
088
089    public String getRevision() {
090        return revision;
091    }
092
093    public void setRevision(String revision) {
094        this.revision = revision;
095    }
096
097    public String getNodeKind() {
098        return nodeKind;
099    }
100
101    public void setNodeKind(String nodeKind) {
102        this.nodeKind = nodeKind;
103    }
104
105    public String getSchedule() {
106        return schedule;
107    }
108
109    public void setSchedule(String schedule) {
110        this.schedule = schedule;
111    }
112
113    public String getLastChangedAuthor() {
114        return lastChangedAuthor;
115    }
116
117    public void setLastChangedAuthor(String lastChangedAuthor) {
118        this.lastChangedAuthor = lastChangedAuthor;
119    }
120
121    public String getLastChangedRevision() {
122        return lastChangedRevision;
123    }
124
125    public void setLastChangedRevision(String lastChangedRevision) {
126        this.lastChangedRevision = lastChangedRevision;
127    }
128
129    /**
130     * @deprecated Use {@link #getLastChangedDateTime()} instead
131     */
132    @Deprecated
133    public String getLastChangedDate() {
134        return lastChangedDate;
135    }
136
137    /**
138     * @deprecated Use {@link #setLastChangedDateTime(TemporalAccessor)} instead
139     */
140    @Deprecated
141    public void setLastChangedDate(String lastChangedDate) {
142        this.lastChangedDate = lastChangedDate;
143    }
144
145    /**
146     *
147     * @return the date when the file indicated via {@link #getPath()} has been changed in the SCM for the last time
148     * @since 2.1.0
149     */
150    public OffsetDateTime getLastChangedDateTime() {
151        return lastChangedDateTime;
152    }
153
154    /**
155     * @param accessor temporal accessor from which to populate the last changed date
156     * @since 2.1.0
157     */
158    public void setLastChangedDateTime(TemporalAccessor accessor) {
159        this.lastChangedDateTime = OffsetDateTime.from(accessor);
160    }
161}