View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one
3    * or more contributor license agreements.  See the NOTICE file
4    * distributed with this work for additional information
5    * regarding copyright ownership.  The ASF licenses this file
6    * to you under the Apache License, Version 2.0 (the
7    * "License"); you may not use this file except in compliance
8    * with the License.  You may obtain a copy of the License at
9    *
10   *   http://www.apache.org/licenses/LICENSE-2.0
11   *
12   * Unless required by applicable law or agreed to in writing,
13   * software distributed under the License is distributed on an
14   * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15   * KIND, either express or implied.  See the License for the
16   * specific language governing permissions and limitations
17   * under the License.
18   */
19  package org.apache.maven.scm.command.info;
20  
21  import java.time.OffsetDateTime;
22  import java.time.temporal.TemporalAccessor;
23  
24  /**
25   * Encapsulates meta information about a file (or directory) being managed with an SCM.
26   *
27   * 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>.
28   *
29   * @author <a href="mailto:kenney@apache.org">Kenney Westerhof</a>
30   * @author Olivier Lamy
31   * @since 1.5
32   */
33  public class InfoItem {
34      private String path;
35  
36      private String url;
37  
38      private String repositoryRoot;
39  
40      private String repositoryUUID;
41  
42      private String revision;
43  
44      private String nodeKind;
45  
46      private String schedule;
47  
48      private String lastChangedAuthor;
49  
50      private String lastChangedRevision;
51  
52      private String lastChangedDate;
53  
54      private OffsetDateTime lastChangedDateTime;
55  
56      public String getPath() {
57          return path;
58      }
59  
60      public void setPath(String path) {
61          this.path = path;
62      }
63  
64      public String getURL() {
65          return url;
66      }
67  
68      public void setURL(String url) {
69          this.url = url;
70      }
71  
72      public String getRepositoryRoot() {
73          return repositoryRoot;
74      }
75  
76      public void setRepositoryRoot(String repositoryRoot) {
77          this.repositoryRoot = repositoryRoot;
78      }
79  
80      public String getRepositoryUUID() {
81          return repositoryUUID;
82      }
83  
84      public void setRepositoryUUID(String repositoryUUID) {
85          this.repositoryUUID = repositoryUUID;
86      }
87  
88      public String getRevision() {
89          return revision;
90      }
91  
92      public void setRevision(String revision) {
93          this.revision = revision;
94      }
95  
96      public String getNodeKind() {
97          return nodeKind;
98      }
99  
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 }