View Javadoc
1   // =================== DO NOT EDIT THIS FILE ====================
2   //  Generated by Modello Velocity from model-v3.vm
3   //  template, any modifications will be overwritten.
4   // ==============================================================
5   package org.apache.maven.artifact.repository.metadata;
6   
7   import java.io.Serializable;
8   import java.util.AbstractList;
9   import java.util.Collections;
10  import java.util.HashMap;
11  import java.util.List;
12  import java.util.Map;
13  import java.util.Objects;
14  import java.util.Set;
15  import java.util.stream.Collectors;
16  import java.util.stream.Stream;
17  import org.apache.maven.api.annotations.Generated;
18  import org.apache.maven.api.annotations.Nonnull;
19  
20  @Generated
21  public class Snapshot
22      extends BaseObject
23  {
24  
25      public Snapshot() {
26          this(org.apache.maven.api.metadata.Snapshot.newInstance());
27      }
28  
29      public Snapshot(org.apache.maven.api.metadata.Snapshot delegate) {
30          this(delegate, null);
31      }
32  
33      public Snapshot(org.apache.maven.api.metadata.Snapshot delegate, BaseObject parent) {
34          super(delegate, parent);
35      }
36  
37      public Snapshot clone(){
38          return new Snapshot(getDelegate());
39      }
40  
41      public org.apache.maven.api.metadata.Snapshot getDelegate() {
42          return (org.apache.maven.api.metadata.Snapshot) super.getDelegate();
43      }
44  
45      @Override
46      public boolean equals(Object o) {
47          if (this == o) {
48              return true;
49          }
50          if (o == null || !(o instanceof Snapshot)) {
51              return false;
52          }
53          Snapshot that = (Snapshot) o;
54          return Objects.equals(this.delegate, that.delegate);
55      }
56  
57      @Override
58      public int hashCode() {
59          return getDelegate().hashCode();
60      }
61  
62      public String getTimestamp() {
63          return getDelegate().getTimestamp();
64      }
65  
66      public void setTimestamp(String timestamp) {
67          if (!Objects.equals(timestamp, getTimestamp())) {
68              update(getDelegate().withTimestamp(timestamp));
69          }
70      }
71  
72      public int getBuildNumber() {
73          return getDelegate().getBuildNumber();
74      }
75  
76      public void setBuildNumber(int buildNumber) {
77          if (!Objects.equals(buildNumber, getBuildNumber())) {
78              update(getDelegate().withBuildNumber(buildNumber));
79          }
80      }
81  
82      public boolean isLocalCopy() {
83          return getDelegate().isLocalCopy();
84      }
85  
86      public void setLocalCopy(boolean localCopy) {
87          if (!Objects.equals(localCopy, isLocalCopy())) {
88              update(getDelegate().withLocalCopy(localCopy));
89          }
90      }
91  
92      protected boolean replace(Object oldDelegate, Object newDelegate) {
93          if (super.replace(oldDelegate, newDelegate)) {
94              return true;
95          }
96          return false;
97      }
98  
99      public static List<org.apache.maven.api.metadata.Snapshot> snapshotToApiV4(List<Snapshot> list) {
100         return list != null ? new WrapperList<>(list, Snapshot::getDelegate, Snapshot::new) : null;
101     }
102 
103     public static List<Snapshot> snapshotToApiV3(List<org.apache.maven.api.metadata.Snapshot> list) {
104         return list != null ? new WrapperList<>(list, Snapshot::new, Snapshot::getDelegate) : null;
105     }
106 
107 }