View Javadoc
1   package com.simpligility.maven.plugins.android.configuration;
2   
3   /**
4    * Abstraction for uses-sdk tag in the Android manifest.
5    *
6    * @author Francisco Javier Fernandez fjfernandez@tuenti.com
7    */
8   
9   public class UsesSdk
10  {
11      private String minSdkVersion;
12      private String maxSdkVersion;
13      private String targetSdkVersion;
14  
15      private static final int PRIME_NUMBER = 31;
16  
17      public String getMinSdkVersion()
18      {
19          return minSdkVersion;
20      }
21  
22      public String getMaxSdkVersion()
23      {
24          return maxSdkVersion;
25      }
26  
27      public String getTargetSdkVersion()
28      {
29          return targetSdkVersion;
30      }
31  
32      @Override
33      public boolean equals( Object o )
34      {
35          if ( this == o )
36          {
37              return true;
38          }
39          if ( o == null || getClass() != o.getClass() )
40          {
41              return false;
42          }
43  
44          UsesSdk usesSdk = ( UsesSdk ) o;
45  
46          if ( maxSdkVersion != null
47                  ? !maxSdkVersion.equals( usesSdk.maxSdkVersion )
48                  : usesSdk.maxSdkVersion != null )
49          {
50              return false;
51          }
52          if ( minSdkVersion != null
53                  ? !minSdkVersion.equals( usesSdk.minSdkVersion )
54                  : usesSdk.minSdkVersion != null )
55          {
56              return false;
57          }
58          if ( targetSdkVersion != null
59                  ? !targetSdkVersion.equals( usesSdk.targetSdkVersion )
60                  : usesSdk.targetSdkVersion != null )
61          {
62              return false;
63          }
64  
65          return true;
66      }
67  
68      @Override
69      public int hashCode()
70      {
71          int result = minSdkVersion != null ? minSdkVersion.hashCode() : 0;
72          result = PRIME_NUMBER * result + ( maxSdkVersion != null ? maxSdkVersion.hashCode() : 0 );
73          result = PRIME_NUMBER * result + ( targetSdkVersion != null ? targetSdkVersion.hashCode() : 0 );
74          return result;
75      }
76  
77      @Override
78      public String toString()
79      {
80          return minSdkVersion + " : " + maxSdkVersion + " : " + targetSdkVersion;
81      }
82  }