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.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 PluginConfiguration
23      extends PluginContainer
24      implements Serializable, Cloneable
25  {
26  
27      public PluginConfiguration() {
28          this(org.apache.maven.api.model.PluginConfiguration.newInstance());
29      }
30  
31      public PluginConfiguration(org.apache.maven.api.model.PluginConfiguration delegate) {
32          this(delegate, null);
33      }
34  
35      public PluginConfiguration(org.apache.maven.api.model.PluginConfiguration delegate, BaseObject parent) {
36          super(delegate, parent);
37      }
38  
39      public PluginConfiguration clone(){
40          return new PluginConfiguration(getDelegate());
41      }
42  
43      @Override
44      public org.apache.maven.api.model.PluginConfiguration getDelegate() {
45          return (org.apache.maven.api.model.PluginConfiguration) 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 PluginConfiguration)) {
54              return false;
55          }
56          PluginConfiguration that = (PluginConfiguration) 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 PluginManagement getPluginManagement() {
66          return getDelegate().getPluginManagement() != null ? new PluginManagement(getDelegate().getPluginManagement(), this) : null;
67      }
68  
69      public void setPluginManagement(PluginManagement pluginManagement) {
70          if (!Objects.equals(pluginManagement, getPluginManagement())){
71              if (pluginManagement != null) {
72                  update(getDelegate().withPluginManagement(pluginManagement.getDelegate()));
73                  pluginManagement.childrenTracking = this::replace;
74              } else {
75                  update(getDelegate().withPluginManagement(null));
76              }
77          }
78      }
79  
80      public InputLocation getLocation(Object key) {
81          org.apache.maven.api.model.InputLocation loc = getDelegate().getLocation(key);
82          return loc != null ? new InputLocation(loc) : null;
83      }
84  
85      public void setLocation(Object key, InputLocation location) {
86          update(org.apache.maven.api.model.PluginConfiguration.newBuilder(getDelegate(), true)
87                          .location(key, location.toApiLocation()).build());
88      }
89  
90      public InputLocation getImportedFrom() {
91          org.apache.maven.api.model.InputLocation loc = getDelegate().getImportedFrom();
92          return loc != null ? new InputLocation(loc) : null;
93      }
94  
95      public void setImportedFrom(InputLocation location) {
96          update(org.apache.maven.api.model.PluginConfiguration.newBuilder(getDelegate(), true)
97                          .importedFrom(location.toApiLocation()).build());
98      }
99  
100     public Set<Object> getLocationKeys() {
101         return getDelegate().getLocationKeys();
102     }
103 
104     protected boolean replace(Object oldDelegate, Object newDelegate) {
105         if (super.replace(oldDelegate, newDelegate)) {
106             return true;
107         }
108         if (oldDelegate == getDelegate().getPluginManagement()) {
109             update(getDelegate().withPluginManagement((org.apache.maven.api.model.PluginManagement) newDelegate));
110             return true;
111         }
112         return false;
113     }
114 
115     public static List<org.apache.maven.api.model.PluginConfiguration> pluginConfigurationToApiV4(List<PluginConfiguration> list) {
116         return list != null ? new WrapperList<>(list, PluginConfiguration::getDelegate, PluginConfiguration::new) : null;
117     }
118 
119     public static List<PluginConfiguration> pluginConfigurationToApiV3(List<org.apache.maven.api.model.PluginConfiguration> list) {
120         return list != null ? new WrapperList<>(list, PluginConfiguration::new, PluginConfiguration::getDelegate) : null;
121     }
122 
123 
124             
125     /**
126      * @see java.lang.Object#toString()
127      */
128     public String toString()
129     {
130         return "PluginConfiguration {" + super.toString() + "}";
131     }
132             
133           
134 }