File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
arduino-core/src/cc/arduino/contributions Expand file tree Collapse file tree 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) {
6565 }
6666 }
6767
68+ public static int compare (String a , String b ) {
69+ return valueOf (a ).get ().compareTo (valueOf (b ).get ());
70+ }
6871}
Original file line number Diff line number Diff line change 3232import cc .arduino .contributions .DownloadableContribution ;
3333import processing .app .I18n ;
3434import processing .app .packages .UserLibrary ;
35+ import static processing .app .I18n .tr ;
3536
3637import java .util .Comparator ;
3738import java .util .List ;
3839import java .util .Optional ;
3940
40- import static processing . app . I18n . tr ;
41+ import cc . arduino . contributions . VersionHelper ;
4142
4243public abstract class ContributedLibrary extends DownloadableContribution {
4344
@@ -181,6 +182,10 @@ public boolean equals(Object obj) {
181182 return versionEquals && nameEquals ;
182183 }
183184
185+ public boolean isBefore (ContributedLibrary other ) {
186+ return VersionHelper .compare (getVersion (), other .getVersion ()) < 0 ;
187+ }
188+
184189 @ Override
185190 public int hashCode () {
186191 String hashingData = "CONTRIBUTEDLIB" + getName () + getVersion ();
You can’t perform that action at this time.
0 commit comments