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