File tree 2 files changed +9
-1
lines changed
arduino-core/src/cc/arduino/contributions
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -65,4 +65,7 @@ public static Optional<Version> valueOf(String ver) {
65
65
}
66
66
}
67
67
68
+ public static int compare (String a , String b ) {
69
+ return valueOf (a ).get ().compareTo (valueOf (b ).get ());
70
+ }
68
71
}
Original file line number Diff line number Diff line change 32
32
import cc .arduino .contributions .DownloadableContribution ;
33
33
import processing .app .I18n ;
34
34
import processing .app .packages .UserLibrary ;
35
+ import static processing .app .I18n .tr ;
35
36
36
37
import java .util .Comparator ;
37
38
import java .util .List ;
38
39
import java .util .Optional ;
39
40
40
- import static processing . app . I18n . tr ;
41
+ import cc . arduino . contributions . VersionHelper ;
41
42
42
43
public abstract class ContributedLibrary extends DownloadableContribution {
43
44
@@ -181,6 +182,10 @@ public boolean equals(Object obj) {
181
182
return versionEquals && nameEquals ;
182
183
}
183
184
185
+ public boolean isBefore (ContributedLibrary other ) {
186
+ return VersionHelper .compare (getVersion (), other .getVersion ()) < 0 ;
187
+ }
188
+
184
189
@ Override
185
190
public int hashCode () {
186
191
String hashingData = "CONTRIBUTEDLIB" + getName () + getVersion ();
You can’t perform that action at this time.
0 commit comments