1
2
3
4
5 package org.apache.maven.settings;
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 IdentifiableBase
22 extends TrackableBase
23 implements Serializable, Cloneable
24 {
25
26 public IdentifiableBase() {
27 this(org.apache.maven.api.settings.IdentifiableBase.newInstance());
28 }
29
30 public IdentifiableBase(org.apache.maven.api.settings.IdentifiableBase delegate) {
31 this(delegate, null);
32 }
33
34 public IdentifiableBase(org.apache.maven.api.settings.IdentifiableBase delegate, BaseObject parent) {
35 super(delegate, parent);
36 }
37
38 public IdentifiableBase clone(){
39 return new IdentifiableBase(getDelegate());
40 }
41
42 @Override
43 public org.apache.maven.api.settings.IdentifiableBase getDelegate() {
44 return (org.apache.maven.api.settings.IdentifiableBase) super.getDelegate();
45 }
46
47 @Override
48 public boolean equals(Object o) {
49 if (this == o) {
50 return true;
51 }
52 if (o == null || !(o instanceof IdentifiableBase)) {
53 return false;
54 }
55 IdentifiableBase that = (IdentifiableBase) o;
56 return Objects.equals(this.delegate, that.delegate);
57 }
58
59 @Override
60 public int hashCode() {
61 return getDelegate().hashCode();
62 }
63
64 public String getId() {
65 return getDelegate().getId();
66 }
67
68 public void setId(String id) {
69 if (!Objects.equals(id, getId())) {
70 update(getDelegate().withId(id));
71 }
72 }
73
74 protected boolean replace(Object oldDelegate, Object newDelegate) {
75 if (super.replace(oldDelegate, newDelegate)) {
76 return true;
77 }
78 return false;
79 }
80
81 public static List<org.apache.maven.api.settings.IdentifiableBase> identifiableBaseToApiV4(List<IdentifiableBase> list) {
82 return list != null ? new WrapperList<>(list, IdentifiableBase::getDelegate, IdentifiableBase::new) : null;
83 }
84
85 public static List<IdentifiableBase> identifiableBaseToApiV3(List<org.apache.maven.api.settings.IdentifiableBase> list) {
86 return list != null ? new WrapperList<>(list, IdentifiableBase::new, IdentifiableBase::getDelegate) : null;
87 }
88
89 }