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 SnapshotVersion
21 extends BaseObject
22 {
23
24 public SnapshotVersion() {
25 this(org.apache.maven.artifact.repository.metadata.v4.SnapshotVersion.newInstance());
26 }
27
28 public SnapshotVersion(org.apache.maven.artifact.repository.metadata.v4.SnapshotVersion delegate) {
29 this(delegate, null);
30 }
31
32 public SnapshotVersion(org.apache.maven.artifact.repository.metadata.v4.SnapshotVersion delegate, BaseObject parent) {
33 super(delegate, parent);
34 }
35
36 public SnapshotVersion clone(){
37 return new SnapshotVersion(getDelegate());
38 }
39
40 public org.apache.maven.artifact.repository.metadata.v4.SnapshotVersion getDelegate() {
41 return (org.apache.maven.artifact.repository.metadata.v4.SnapshotVersion) 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 SnapshotVersion)) {
50 return false;
51 }
52 SnapshotVersion that = (SnapshotVersion) 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 getClassifier() {
62 return getDelegate().getClassifier();
63 }
64
65 public void setClassifier(String classifier) {
66 if (!Objects.equals(classifier, getClassifier())) {
67 update(getDelegate().withClassifier(classifier));
68 }
69 }
70
71 public String getExtension() {
72 return getDelegate().getExtension();
73 }
74
75 public void setExtension(String extension) {
76 if (!Objects.equals(extension, getExtension())) {
77 update(getDelegate().withExtension(extension));
78 }
79 }
80
81 public String getVersion() {
82 return getDelegate().getVersion();
83 }
84
85 public void setVersion(String version) {
86 if (!Objects.equals(version, getVersion())) {
87 update(getDelegate().withVersion(version));
88 }
89 }
90
91 public String getUpdated() {
92 return getDelegate().getUpdated();
93 }
94
95 public void setUpdated(String updated) {
96 if (!Objects.equals(updated, getUpdated())) {
97 update(getDelegate().withUpdated(updated));
98 }
99 }
100
101 protected boolean replace(Object oldDelegate, Object newDelegate) {
102 if (super.replace(oldDelegate, newDelegate)) {
103 return true;
104 }
105 return false;
106 }
107
108 public static List<org.apache.maven.artifact.repository.metadata.v4.SnapshotVersion> snapshotVersionToApiV4(List<SnapshotVersion> list) {
109 return list != null ? new WrapperList<>(list, SnapshotVersion::getDelegate, SnapshotVersion::new) : null;
110 }
111
112 public static List<SnapshotVersion> snapshotVersionToApiV3(List<org.apache.maven.artifact.repository.metadata.v4.SnapshotVersion> list) {
113 return list != null ? new WrapperList<>(list, SnapshotVersion::new, SnapshotVersion::getDelegate) : null;
114 }
115
116 }