12
12
13
13
import java .io .File ;
14
14
import java .util .ArrayList ;
15
- import java .util .Arrays ;
16
15
import java .util .List ;
17
16
18
17
import org .eclipse .core .runtime .IPath ;
25
24
26
25
public class ArduinoPlatformVersion extends ArduinoInstallable implements Comparable <ArduinoPlatformVersion > {
27
26
28
- private String architecture ;
29
- private VersionNumber version ;
30
- private String category ;
27
+ private String myArchitecture ;
28
+ private VersionNumber myVersion ;
29
+ private String myCategory ;
31
30
32
- private List <String > boards = new ArrayList <>();
33
- private List <ArduinoPlatformTooldDependency > toolsDependencies = new ArrayList <>(); ;
31
+ private List <String > myBoards = new ArrayList <>();
32
+ private List <ArduinoPlatformTooldDependency > myToolDependencies = new ArrayList <>();
34
33
35
34
private ArduinoPlatform myParent ;
36
35
@@ -40,20 +39,20 @@ public ArduinoPlatformVersion(JsonElement json, ArduinoPlatform parent) {
40
39
JsonObject jsonObject = json .getAsJsonObject ();
41
40
42
41
try {
43
- name = getSafeString (jsonObject , "name" );
44
- architecture = getSafeString (jsonObject , "architecture" );
45
- version = getSafeVersion (jsonObject , "version" );
46
- category = getSafeString (jsonObject , "category" );
47
- url = getSafeString (jsonObject , "url" );
48
- archiveFileName = getSafeString (jsonObject , "archiveFileName" );
49
- checksum = getSafeString (jsonObject , "checksum" );
50
- size = getSafeString (jsonObject , "size" );
42
+ myName = getSafeString (jsonObject , "name" );
43
+ myArchitecture = getSafeString (jsonObject , "architecture" );
44
+ myVersion = getSafeVersion (jsonObject , "version" );
45
+ myCategory = getSafeString (jsonObject , "category" );
46
+ myURL = getSafeString (jsonObject , "url" );
47
+ myArchiveFileName = getSafeString (jsonObject , "archiveFileName" );
48
+ myChecksum = getSafeString (jsonObject , "checksum" );
49
+ mySize = getSafeString (jsonObject , "size" );
51
50
for (JsonElement curElement : jsonObject .get ("boards" ).getAsJsonArray ()) {
52
- boards .add (getSafeString (curElement .getAsJsonObject (), "name" ));
51
+ myBoards .add (getSafeString (curElement .getAsJsonObject (), "name" ));
53
52
}
54
53
if (jsonObject .get ("toolsDependencies" ) != null ) {
55
54
for (JsonElement curElement : jsonObject .get ("toolsDependencies" ).getAsJsonArray ()) {
56
- toolsDependencies .add (new ArduinoPlatformTooldDependency (curElement , this ));
55
+ myToolDependencies .add (new ArduinoPlatformTooldDependency (curElement , this ));
57
56
}
58
57
}
59
58
} catch (Exception e ) {
@@ -66,19 +65,19 @@ public ArduinoPlatform getParent() {
66
65
}
67
66
68
67
public String getArchitecture () {
69
- return architecture ;
68
+ return myArchitecture ;
70
69
}
71
70
72
71
public VersionNumber getVersion () {
73
- return version ;
72
+ return myVersion ;
74
73
}
75
74
76
75
public String getCategory () {
77
- return category ;
76
+ return myCategory ;
78
77
}
79
78
80
79
public List <ArduinoPlatformTooldDependency > getToolsDependencies () {
81
- return toolsDependencies ;
80
+ return myToolDependencies ;
82
81
}
83
82
84
83
public boolean isInstalled () {
@@ -95,22 +94,17 @@ public File getPlatformFile() {
95
94
96
95
@ Override
97
96
public IPath getInstallPath () {
98
- return getParent ().getInstallPath ().append (this .version .toString ());
97
+ return getParent ().getInstallPath ().append (this .myVersion .toString ());
99
98
}
100
99
101
- public List <IPath > getIncludePath () {
102
- IPath installPath = getInstallPath ();
103
- return Arrays .asList (installPath .append ("cores/{build.core}" ), //$NON-NLS-1$
104
- installPath .append (ARDUINO_VARIANTS_FOLDER_NAME + "/{build.variant}" )); //$NON-NLS-1$
105
- }
106
100
107
101
@ Override
108
102
public int hashCode () {
109
103
final int prime = 31 ;
110
104
int result = 1 ;
111
- result = prime * result + ((this .name == null ) ? 0 : this .name .hashCode ());
105
+ result = prime * result + ((this .myName == null ) ? 0 : this .myName .hashCode ());
112
106
result = prime * result + ((this .myParent == null ) ? 0 : this .myParent .hashCode ());
113
- result = prime * result + ((this .version == null ) ? 0 : this .version .hashCode ());
107
+ result = prime * result + ((this .myVersion == null ) ? 0 : this .myVersion .hashCode ());
114
108
return result ;
115
109
}
116
110
@@ -123,30 +117,30 @@ public boolean equals(Object obj) {
123
117
if (getClass () != obj .getClass ())
124
118
return false ;
125
119
ArduinoPlatformVersion other = (ArduinoPlatformVersion ) obj ;
126
- if (this .name == null ) {
127
- if (other .name != null )
120
+ if (this .myName == null ) {
121
+ if (other .myName != null )
128
122
return false ;
129
- } else if (!this .name .equals (other .name ))
123
+ } else if (!this .myName .equals (other .myName ))
130
124
return false ;
131
125
if (this .myParent == null ) {
132
126
if (other .myParent != null )
133
127
return false ;
134
128
} else if (!this .myParent .equals (other .myParent ))
135
129
return false ;
136
- if (this .version == null ) {
137
- if (other .version != null )
130
+ if (this .myVersion == null ) {
131
+ if (other .myVersion != null )
138
132
return false ;
139
- } else if (!this .version .equals (other .version ))
133
+ } else if (!this .myVersion .equals (other .myVersion ))
140
134
return false ;
141
135
return true ;
142
136
}
143
137
144
138
public List <String > getBoardNames () {
145
- return boards ;
139
+ return myBoards ;
146
140
}
147
141
148
142
public String getID () {
149
- return version .toString ();
143
+ return myVersion .toString ();
150
144
}
151
145
152
146
public String getConcattenatedBoardNames () {
@@ -155,12 +149,12 @@ public String getConcattenatedBoardNames() {
155
149
156
150
@ Override
157
151
public int compareTo (ArduinoPlatformVersion o ) {
158
- return name .compareTo (o .getName ());
152
+ return myName .compareTo (o .getName ());
159
153
}
160
154
161
155
@ Override
162
156
public String toString () {
163
- return name + SPACE + architecture + '(' + version + ')' ;
157
+ return myName + SPACE + myArchitecture + '(' + myVersion + ')' ;
164
158
}
165
159
166
160
}
0 commit comments