-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #376 from lets-blade/dev
Dev
- Loading branch information
Showing
20 changed files
with
241 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
name: 📚 Documentation Issue | ||
about: For documentation issues, open a pull request at https://github.com/lets-blade/lets-blade.github.io | ||
|
||
--- | ||
|
||
The blade documentation has its own dedicated repository. Please open a pull request at https://github.com/lets-blade/lets-blade.github.io to correct the issue you have found. | ||
|
||
Thanks! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
--- | ||
name: Feature request | ||
about: Suggest an idea for this project | ||
name: ✨ Feature Request | ||
about: For ideas or feature requests | ||
|
||
--- | ||
|
||
**Is your feature request related to a problem? Please describe.** | ||
### Is your feature request related to a problem? Please describe.** | ||
|
||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] | ||
|
||
**Describe the solution you'd like** | ||
### Describe the solution you'd like | ||
|
||
A clear and concise description of what you want to happen. | ||
|
||
**Describe alternatives you've considered** | ||
### Describe alternatives you've considered** | ||
|
||
A clear and concise description of any alternative solutions or features you've considered. | ||
|
||
**Additional context** | ||
### Additional context | ||
|
||
Add any other context or screenshots about the feature request here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
name: General question | ||
name: 🍻 General Question | ||
about: Template for asking question | ||
|
||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.blade.ioc.annotation; | ||
|
||
import java.lang.annotation.*; | ||
|
||
/** | ||
* @author <a href="mailto:fishlikewater@126.com" target="_blank">zhangx</a> | ||
* @since 2.0.15 | ||
**/ | ||
@Target(ElementType.TYPE) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Documented | ||
public @interface Configuration { | ||
|
||
String name() default ""; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
package com.blade.kit; | ||
|
||
import com.blade.exception.BladeException; | ||
|
||
import java.util.function.BiConsumer; | ||
import java.util.function.Consumer; | ||
import java.util.function.Function; | ||
import java.util.function.Supplier; | ||
|
||
/** | ||
* @author darren | ||
* @date 2019/3/18 11:47 | ||
*/ | ||
public class UncheckedFnKit { | ||
|
||
@FunctionalInterface | ||
public interface Consumer_WithExceptions<T, E extends Throwable> { | ||
void accept(T t) throws E; | ||
} | ||
|
||
@FunctionalInterface | ||
public interface BiConsumer_WithExceptions<T, U, E extends Throwable> { | ||
void accept(T t, U u) throws E; | ||
} | ||
|
||
@FunctionalInterface | ||
public interface Function_WithExceptions<T, R, E extends Throwable> { | ||
R apply(T t) throws E; | ||
} | ||
|
||
@FunctionalInterface | ||
public interface Supplier_WithExceptions<T, E extends Throwable> { | ||
T get() throws E; | ||
} | ||
|
||
@FunctionalInterface | ||
public interface Runnable_WithExceptions<E extends Throwable> { | ||
void run() throws E; | ||
} | ||
|
||
public static <T> Consumer<T> consumer(Consumer_WithExceptions<T, Throwable> consumer) { | ||
return t -> { | ||
try { | ||
consumer.accept(t); | ||
} catch (Throwable throwable) { | ||
throw new BladeException(throwable); | ||
} | ||
}; | ||
} | ||
|
||
public static <T, U> BiConsumer<T, U> biConsumer(BiConsumer_WithExceptions<T, U, Throwable> biConsumer) { | ||
return (t, u) -> { | ||
try { | ||
biConsumer.accept(t, u); | ||
} catch (Throwable throwable) { | ||
throw new BladeException(throwable); | ||
} | ||
}; | ||
} | ||
|
||
public static <T, R> Function<T, R> function(Function_WithExceptions<T, R, Throwable> function) { | ||
return t -> { | ||
try { | ||
return function.apply(t); | ||
} catch (Throwable throwable) { | ||
throw new BladeException(throwable); | ||
} | ||
}; | ||
} | ||
|
||
public static <T> Supplier<T> supplier(Supplier_WithExceptions<T, Throwable> function) { | ||
return () -> { | ||
try { | ||
return function.get(); | ||
} catch (Throwable throwable) { | ||
throw new BladeException(throwable); | ||
} | ||
}; | ||
} | ||
|
||
public static Runnable runnable(Runnable_WithExceptions t) { | ||
return ()-> { | ||
try { | ||
t.run(); | ||
} catch (Throwable throwable) { | ||
throw new BladeException(throwable); | ||
} | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.