1
2
3
4
5 package org.apache.maven.model;
6
7 import java.io.Serializable;
8 import java.util.AbstractList;
9 import java.util.ArrayList;
10 import java.util.Collections;
11 import java.util.HashMap;
12 import java.util.List;
13 import java.util.Map;
14 import java.util.Objects;
15 import java.util.Set;
16 import java.util.stream.Collectors;
17 import java.util.stream.Stream;
18 import org.apache.maven.api.annotations.Generated;
19 import org.apache.maven.api.annotations.Nonnull;
20
21 @Generated
22 public class PluginManagement
23 extends PluginContainer
24 implements Serializable, Cloneable
25 {
26
27 public PluginManagement() {
28 this(org.apache.maven.api.model.PluginManagement.newInstance());
29 }
30
31 public PluginManagement(org.apache.maven.api.model.PluginManagement delegate) {
32 this(delegate, null);
33 }
34
35 public PluginManagement(org.apache.maven.api.model.PluginManagement delegate, BaseObject parent) {
36 super(delegate, parent);
37 }
38
39 public PluginManagement clone(){
40 return new PluginManagement(getDelegate());
41 }
42
43 @Override
44 public org.apache.maven.api.model.PluginManagement getDelegate() {
45 return (org.apache.maven.api.model.PluginManagement) super.getDelegate();
46 }
47
48 @Override
49 public boolean equals(Object o) {
50 if (this == o) {
51 return true;
52 }
53 if (o == null || !(o instanceof PluginManagement)) {
54 return false;
55 }
56 PluginManagement that = (PluginManagement) o;
57 return Objects.equals(this.delegate, that.delegate);
58 }
59
60 @Override
61 public int hashCode() {
62 return getDelegate().hashCode();
63 }
64
65 public InputLocation getLocation(Object key) {
66 org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation(key);
67 return loc != null ? new InputLocation(loc) : null;
68 }
69
70 public void setLocation(Object key, InputLocation location) {
71 update(org.apache.maven.api.model.PluginManagement.newBuilder(getDelegate(), true)
72 .location(key, location.toApiLocation()).build());
73 }
74
75 public InputLocation getImportedFrom() {
76 org.apache.maven.api.model.InputLocation loc = getDelegate().getImportedFrom();
77 return loc != null ? new InputLocation(loc) : null;
78 }
79
80 public void setImportedFrom(InputLocation location) {
81 update(org.apache.maven.api.model.PluginManagement.newBuilder(getDelegate(), true)
82 .importedFrom(location.toApiLocation()).build());
83 }
84
85 public Set<Object> getLocationKeys() {
86 return getDelegate().getLocationKeys();
87 }
88
89 protected boolean replace(Object oldDelegate, Object newDelegate) {
90 if (super.replace(oldDelegate, newDelegate)) {
91 return true;
92 }
93 return false;
94 }
95
96 public static List<org.apache.maven.api.model.PluginManagement> pluginManagementToApiV4(List<PluginManagement> list) {
97 return list != null ? new WrapperList<>(list, PluginManagement::getDelegate, PluginManagement::new) : null;
98 }
99
100 public static List<PluginManagement> pluginManagementToApiV3(List<org.apache.maven.api.model.PluginManagement> list) {
101 return list != null ? new WrapperList<>(list, PluginManagement::new, PluginManagement::getDelegate) : null;
102 }
103
104 }