1   package com.atlassian.plugins.codegen;
2   
3   import static com.google.common.base.Preconditions.checkNotNull;
4   
5   /**
6    * Holds the new AMPS version that should be updated in the pom.
7    * If the POM already has an amps.version property, it will be updated. Otherwise a new property will be created.
8    * Also, if the amps plugin is using a hardcoded version, it will be updated to use the amps.version property.
9    */
10  public class AmpsVersionUpdate implements PluginProjectChange
11  {
12      private final String version;
13  
14      public static AmpsVersionUpdate ampsVersionUpdate(String version)
15      {
16          return new AmpsVersionUpdate(version);
17      }
18  
19      private AmpsVersionUpdate(String version)
20      {
21          this.version = checkNotNull(version, "version");
22      }
23  
24      public String getVersion()
25      {
26          return version;
27      }
28  
29      @Override
30      public String toString()
31      {
32          return "[AMPS Version Update: " + version + "]";
33      }
34  }