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   *
32   * @since 1.5
33   */
34  public class InfoItem {
35      private String path;
36  
37      private String url;
38  
39      private String repositoryRoot;
40  
41      private String repositoryUUID;
42  
43      private String revision;
44  
45      private String nodeKind;
46  
47      private String schedule;
48  
49      private String lastChangedAuthor;
50  
51      private String lastChangedRevision;
52  
53      private String lastChangedDate;
54  
55      private OffsetDateTime lastChangedDateTime;
56  
57      public String getPath() {
58          return path;
59      }
60  
61      public void setPath(String path) {
62          this.path = path;
63      }
64  
65      public String getURL() {
66          return url;
67      }
68  
69      public void setURL(String url) {
70          this.url = url;
71      }
72  
73      public String getRepositoryRoot() {
74          return repositoryRoot;
75      }
76  
77      public void setRepositoryRoot(String repositoryRoot) {
78          this.repositoryRoot = repositoryRoot;
79      }
80  
81      public String getRepositoryUUID() {
82          return repositoryUUID;
83      }
84  
85      public void setRepositoryUUID(String repositoryUUID) {
86          this.repositoryUUID = repositoryUUID;
87      }
88  
89      public String getRevision() {
90          return revision;
91      }
92  
93      public void setRevision(String revision) {
94          this.revision = revision;
95      }
96  
97      public String getNodeKind() {
98          return nodeKind;
99      }
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 }