File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
arduino-core/src/cc/arduino/contributions Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -64,4 +64,7 @@ public static Version valueOf(String ver) {
64
64
}
65
65
}
66
66
67
+ public static int compare (String a , String b ) {
68
+ return valueOf (a ).compareTo (valueOf (b ));
69
+ }
67
70
}
Original file line number Diff line number Diff line change 29
29
30
30
package cc .arduino .contributions .libraries ;
31
31
32
- import cc .arduino .contributions .DownloadableContribution ;
33
- import processing .app .I18n ;
32
+ import static processing .app .I18n .tr ;
34
33
35
34
import java .util .Comparator ;
36
35
import java .util .List ;
37
36
38
- import static processing .app .I18n .tr ;
37
+ import cc .arduino .contributions .DownloadableContribution ;
38
+ import cc .arduino .contributions .VersionHelper ;
39
+ import processing .app .I18n ;
39
40
40
41
public abstract class ContributedLibrary extends DownloadableContribution {
41
42
@@ -152,6 +153,10 @@ public boolean equals(Object obj) {
152
153
return versionEquals && nameEquals ;
153
154
}
154
155
156
+ public boolean isBefore (ContributedLibrary other ) {
157
+ return VersionHelper .compare (getVersion (), other .getVersion ()) < 0 ;
158
+ }
159
+
155
160
@ Override
156
161
public int hashCode () {
157
162
String hashingData = "CONTRIBUTEDLIB" + getName () + getVersion ();
You can’t perform that action at this time.
0 commit comments