Ranides Atterwim пре 4 година
родитељ
комит
bef08d8512

+ 21 - 21
assira.core/src/main/java/net/ranides/assira/collection/query/CQuery.java

@@ -230,11 +230,11 @@ public interface CQuery<T> extends Iterable<T> {
             return new CQueryAbstract.CQCollection<>(source);
         }
 
-        public final <T extends F> CQuery<T> collection(Supplier<Collection<T>> source) {
-            return new CQueryAbstract.CQCollection<>(source);
+        public final <T extends F> CQuery<T> collection(CheckedSupplier<Collection<T>, ?> source) {
+            return new CQueryAbstract.CQCollection<>(source::$get);
         }
 
-        public final <T extends F,P> CQuery<T> collection(P param, Function<? super P, Collection<T>> source) {
+        public final <T extends F,P> CQuery<T> collection(P param, CheckedFunction<? super P, Collection<T>, ?> source) {
             return collection(() -> source.apply(param));
         }
 
@@ -242,28 +242,28 @@ public interface CQuery<T> extends Iterable<T> {
             return new CQueryAbstract.CQArray<>(source);
         }
 
-        public final <T extends F> CQuery<T> array(Supplier<T[]> source) {
-            return new CQueryAbstract.CQArray<>(source);
+        public final <T extends F> CQuery<T> array(CheckedSupplier<T[], ?> source) {
+            return new CQueryAbstract.CQArray<>(source::$get);
         }
 
-        public final <T extends F,P> CQuery<T> array(P param, Function<? super P, T[]> source) {
+        public final <T extends F,P> CQuery<T> array(P param, CheckedFunction<? super P, T[], ?> source) {
             return array(() -> source.apply(param));
         }
 
-        public final <T extends F> CQuery<T> query(Supplier<CQuery<T>> source) {
-            return new CQueryAbstract.CQQuery<>(source);
+        public final <T extends F> CQuery<T> query(CheckedSupplier<CQuery<T>, ?> source) {
+            return new CQueryAbstract.CQQuery<>(source::$get);
         }
 
-        public final <T extends F,P> CQuery<T> query(P param, Function<? super P, CQuery<T>> source) {
+        public final <T extends F,P> CQuery<T> query(P param, CheckedFunction<? super P, CQuery<T>, ?> source) {
             return query(() -> source.apply(param));
         }
 
-        public final <T extends F> CQuery<T> infinite(Supplier<T> source) {
-            return iterable(() -> IteratorUtils.infinite(source::get));
+        public final <T extends F> CQuery<T> infinite(CheckedSupplier<T, ?> source) {
+            return iterable(() -> IteratorUtils.infinite(source));
         }
 
-        public final <T extends F> CQuery<T> finite(Supplier<Optional<T>> source) {
-            return iterable(() -> IteratorUtils.finite(source::get));
+        public final <T extends F> CQuery<T> finite(CheckedSupplier<Optional<T>, ?> source) {
+            return iterable(() -> IteratorUtils.finite(source));
         }
 
     }
@@ -296,12 +296,12 @@ public interface CQuery<T> extends Iterable<T> {
             return self();
         }
 
-        public <T extends F> Builder<T> withQuery(Supplier<CQuery<T>> item) {
+        public <T extends F> Builder<T> withQuery(CheckedSupplier<CQuery<T>,?> item) {
             list.add(from().query(item));
             return self();
         }
 
-        public <T extends F, P> Builder<T> withQuery(P param, Function<? super P, CQuery<T>> item) {
+        public <T extends F, P> Builder<T> withQuery(P param, CheckedFunction<? super P, CQuery<T>, ?> item) {
             list.add(from().query(param,item));
             return self();
         }
@@ -310,11 +310,11 @@ public interface CQuery<T> extends Iterable<T> {
             return withQuery(from().iterable(f));
         }
 
-        public <T extends F> Builder<T> withIterable(Supplier<Iterable<T>> f) {
+        public <T extends F> Builder<T> withIterable(CheckedSupplier<Iterable<T>, ?> f) {
             return withQuery(from().iterable(f));
         }
 
-        public <T extends F, P> Builder<T> withIterable(P param, Function<? super P,Iterable<T>> f) {
+        public <T extends F, P> Builder<T> withIterable(P param, CheckedFunction<? super P,Iterable<T>, ?> f) {
             return withQuery(from().iterable(param, f));
         }
 
@@ -322,11 +322,11 @@ public interface CQuery<T> extends Iterable<T> {
             return withQuery(from().collection(f));
         }
 
-        public <T extends F> Builder<T> withCollection(Supplier<Collection<T>> f) {
+        public <T extends F> Builder<T> withCollection(CheckedSupplier<Collection<T>, ?> f) {
             return withQuery(from().collection(f));
         }
 
-        public <T extends F, P> Builder<T> withCollection(P param, Function<? super P, Collection<T>> f) {
+        public <T extends F, P> Builder<T> withCollection(P param, CheckedFunction<? super P, Collection<T>, ?> f) {
             return withQuery(from().collection(param, f));
         }
 
@@ -334,11 +334,11 @@ public interface CQuery<T> extends Iterable<T> {
             return withQuery(from().array(f));
         }
 
-        public <T extends F> Builder<T> withArray(Supplier<T[]> f) {
+        public <T extends F> Builder<T> withArray(CheckedSupplier<T[], ?> f) {
             return withQuery(from().array(f));
         }
 
-        public <T extends F, P> Builder<T> withArray(P param, Function<? super P, T[]> f) {
+        public <T extends F, P> Builder<T> withArray(P param, CheckedFunction<? super P, T[], ?> f) {
             return withQuery(from().array(param, f));
         }
 

+ 1 - 1
assira.core/src/test/java/net/ranides/assira/io/uri/impl/CFileHandlerTest.java

@@ -90,7 +90,7 @@ public class CFileHandlerTest {
         ));
         assertEquals("Hello world", IOStrings.read(handle6.reader()));
 
-        assertTrue("Invalid number of files inside root directory", handle1.scan().size() > 23);
+        assertTrue("Invalid number of files inside root directory", handle1.scan().size() > 20);
         assertEquals(Arrays.asList("indir","text"), handle3.parent().parent().scan().map(f-> asName(f)).sort().list());
         assertEquals(Arrays.asList("info.txt"), handle2.scan().map(f-> asName(f)).sort().list());
         assertThrows(IOException.class, ()->{

+ 3 - 3
scripts/install-core.bat

@@ -1,12 +1,12 @@
 @echo off
 call jdk8
-call mvn -f ../assira.core/pom.xml %* install -P jdk8
+call mvn -f assira.core/pom.xml %* install -P jdk8
 if errorlevel 1 goto fail
-call mvn -f ../assira.core8/pom.xml %* install -P jdk8
+call mvn -f assira.core8/pom.xml %* install -P jdk8
 if errorlevel 1 goto fail
 
 call jdk11
-call mvn -f ../assira.core11/pom.xml %* install -P jdk8
+call mvn -f assira.core11/pom.xml %* install -P jdk8
 if errorlevel 1 goto fail
 
 goto success

+ 1 - 1
scripts/install-jdk11.bat

@@ -1,3 +1,3 @@
 @echo off
 call jdk11
-call mvn -f ../pom.xml %* install -P jdk11
+call mvn -f pom.xml %* install -P jdk11

+ 1 - 1
scripts/install-jdk8.bat

@@ -1,3 +1,3 @@
 @echo off
 call jdk8
-call mvn -f ../pom.xml %* install -P common,jdk8
+call mvn -f pom.xml %* install -P common,jdk8

version-me.bat → scripts/version-me.bat