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 * @since 1.5
032 */
033public class InfoItem {
034    private String path;
035
036    private String url;
037
038    private String repositoryRoot;
039
040    private String repositoryUUID;
041
042    private String revision;
043
044    private String nodeKind;
045
046    private String schedule;
047
048    private String lastChangedAuthor;
049
050    private String lastChangedRevision;
051
052    private String lastChangedDate;
053
054    private OffsetDateTime lastChangedDateTime;
055
056    public String getPath() {
057        return path;
058    }
059
060    public void setPath(String path) {
061        this.path = path;
062    }
063
064    public String getURL() {
065        return url;
066    }
067
068    public void setURL(String url) {
069        this.url = url;
070    }
071
072    public String getRepositoryRoot() {
073        return repositoryRoot;
074    }
075
076    public void setRepositoryRoot(String repositoryRoot) {
077        this.repositoryRoot = repositoryRoot;
078    }
079
080    public String getRepositoryUUID() {
081        return repositoryUUID;
082    }
083
084    public void setRepositoryUUID(String repositoryUUID) {
085        this.repositoryUUID = repositoryUUID;
086    }
087
088    public String getRevision() {
089        return revision;
090    }
091
092    public void setRevision(String revision) {
093        this.revision = revision;
094    }
095
096    public String getNodeKind() {
097        return nodeKind;
098    }
099
100    public void setNodeKind(String nodeKind) {
101        this.nodeKind = nodeKind;
102    }
103
104    public String getSchedule() {
105        return schedule;
106    }
107
108    public void setSchedule(String schedule) {
109        this.schedule = schedule;
110    }
111
112    public String getLastChangedAuthor() {
113        return lastChangedAuthor;
114    }
115
116    public void setLastChangedAuthor(String lastChangedAuthor) {
117        this.lastChangedAuthor = lastChangedAuthor;
118    }
119
120    public String getLastChangedRevision() {
121        return lastChangedRevision;
122    }
123
124    public void setLastChangedRevision(String lastChangedRevision) {
125        this.lastChangedRevision = lastChangedRevision;
126    }
127
128    /**
129     * @deprecated use {@link #getLastChangedDateTime()} instead
130     */
131    @Deprecated
132    public String getLastChangedDate() {
133        return lastChangedDate;
134    }
135
136    /**
137     * @deprecated use {@link #setLastChangedDateTime(TemporalAccessor)} instead
138     */
139    @Deprecated
140    public void setLastChangedDate(String lastChangedDate) {
141        this.lastChangedDate = lastChangedDate;
142    }
143
144    /**
145     * @return the date when the file indicated via {@link #getPath()} has been changed in the SCM for the last time
146     * @since 2.1.0
147     */
148    public OffsetDateTime getLastChangedDateTime() {
149        return lastChangedDateTime;
150    }
151
152    /**
153     * @param accessor temporal accessor from which to populate the last changed date
154     * @since 2.1.0
155     */
156    public void setLastChangedDateTime(TemporalAccessor accessor) {
157        this.lastChangedDateTime = OffsetDateTime.from(accessor);
158    }
159}