mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix doc
This commit is contained in:
parent
2dde8d18d0
commit
8c349c6082
@ -103,8 +103,9 @@ public class Opt<T> {
|
||||
/**
|
||||
* 返回一个包裹里{@code List}集合可能为空的{@code Opt},额外判断了集合内元素为空的情况
|
||||
*
|
||||
* @param value 传入需要包裹的元素
|
||||
* @param <T> 包裹里元素的类型
|
||||
* @param <R> 集合值类型
|
||||
* @param value 传入需要包裹的元素
|
||||
* @return 一个包裹里元素可能为空的 {@code Opt}
|
||||
* @since 5.7.17
|
||||
*/
|
||||
@ -113,7 +114,6 @@ public class Opt<T> {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param supplier 操作
|
||||
* @param <T> 类型
|
||||
* @return 操作执行后的值
|
||||
@ -175,7 +175,7 @@ public class Opt<T> {
|
||||
* @return 异常
|
||||
* @since 5.7.17
|
||||
*/
|
||||
public Exception getException(){
|
||||
public Exception getException() {
|
||||
return this.exception;
|
||||
}
|
||||
|
||||
@ -186,7 +186,7 @@ public class Opt<T> {
|
||||
* @return 是否失败
|
||||
* @since 5.7.17
|
||||
*/
|
||||
public boolean isFail(){
|
||||
public boolean isFail() {
|
||||
return null != this.exception;
|
||||
}
|
||||
|
||||
@ -253,7 +253,7 @@ public class Opt<T> {
|
||||
* String hutool = Opt.ofBlankAble("hutool").mapOrElse(String::toUpperCase, () -> Console.log("yes")).mapOrElse(String::intern, () -> Console.log("Value is not present~")).get();
|
||||
* }</pre>
|
||||
*
|
||||
* @param <U> map后新的类型
|
||||
* @param <U> map后新的类型
|
||||
* @param mapper 包裹里的值存在时的操作
|
||||
* @param emptyAction 包裹里的值不存在时的操作
|
||||
* @return 新的类型的Opt
|
||||
@ -443,7 +443,7 @@ public class Opt<T> {
|
||||
* @return 如果未发生异常,则返回该值,否则返回传入的{@code other}
|
||||
* @since 5.7.17
|
||||
*/
|
||||
public T exceptionOrElse(T other){
|
||||
public T exceptionOrElse(T other) {
|
||||
return isFail() ? other : value;
|
||||
}
|
||||
|
||||
|
@ -23,19 +23,6 @@ public class LambdaUtil {
|
||||
/**
|
||||
* 通过对象的方法或类的静态方法引用,获取lambda实现类
|
||||
* 传入lambda无参数但含有返回值的情况能够匹配到此方法:
|
||||
* <pre>{@code
|
||||
* @Data
|
||||
* @EqualsAndHashCode(callSuper = true)
|
||||
* static class MyTeacher extends Entity<MyTeacher> {
|
||||
*
|
||||
* public String age;
|
||||
*
|
||||
* public static String takeAge() {
|
||||
* return new MyTeacher().getAge();
|
||||
* }
|
||||
*
|
||||
* }
|
||||
* }</pre>
|
||||
* <ul>
|
||||
* <li>引用特定对象的实例方法:<pre>{@code
|
||||
* MyTeacher myTeacher = new MyTeacher();
|
||||
@ -124,19 +111,6 @@ public class LambdaUtil {
|
||||
/**
|
||||
* 通过对象的方法或类的静态方法引用,然后根据{@link SerializedLambda#getInstantiatedMethodType()}获取lambda实现类<br>
|
||||
* 传入lambda有参数且含有返回值的情况能够匹配到此方法:
|
||||
* <pre>{@code
|
||||
* @Data
|
||||
* @EqualsAndHashCode(callSuper = true)
|
||||
* static class MyTeacher extends Entity<MyTeacher> {
|
||||
*
|
||||
* public String age;
|
||||
*
|
||||
* public static String takeAgeBy(MyTeacher myTeacher) {
|
||||
* return myTeacher.getAge();
|
||||
* }
|
||||
*
|
||||
* }
|
||||
* }</pre>
|
||||
* <ul>
|
||||
* <li>引用特定类型的任意对象的实例方法:<pre>{@code
|
||||
* Class<MyTeacher> functionClass = LambdaUtil.getRealClass(MyTeacher::getAge);
|
||||
|
@ -680,7 +680,7 @@ public class MapUtil {
|
||||
* @param <K> {@code key}的类型
|
||||
* @param <V> {@code value}的类型
|
||||
* @param <R> 新的,修改后的{@code value}的类型
|
||||
* @return 值可以为不同类型的 {@link Map
|
||||
* @return 值可以为不同类型的 {@link Map}
|
||||
* @since 5.8.0
|
||||
*/
|
||||
public static <K, V, R> Map<K, R> map(Map<K, V> map, BiFunction<K, V, R> biFunction) {
|
||||
|
@ -136,8 +136,8 @@ public class AntPathMatcher {
|
||||
* are coming in, with little chance for encountering a recurring pattern.
|
||||
*
|
||||
* @param cachePatterns 是否缓存表达式
|
||||
* @see #getStringMatcher(String)
|
||||
* @return this
|
||||
* @see #getStringMatcher(String)
|
||||
*/
|
||||
public AntPathMatcher setCachePatterns(boolean cachePatterns) {
|
||||
this.cachePatterns = cachePatterns;
|
||||
@ -178,7 +178,7 @@ public class AntPathMatcher {
|
||||
* 给定路径是否匹配表达式
|
||||
*
|
||||
* @param pattern 表达式
|
||||
* @param path 路径
|
||||
* @param path 路径
|
||||
* @return 是否匹配
|
||||
*/
|
||||
public boolean match(String pattern, String path) {
|
||||
@ -189,7 +189,7 @@ public class AntPathMatcher {
|
||||
* 前置部分匹配
|
||||
*
|
||||
* @param pattern 表达式
|
||||
* @param path 路径
|
||||
* @param path 路径
|
||||
* @return 是否匹配
|
||||
*/
|
||||
public boolean matchStart(String pattern, String path) {
|
||||
@ -708,6 +708,8 @@ public class AntPathMatcher {
|
||||
/**
|
||||
* Main entry point.
|
||||
*
|
||||
* @param str Str
|
||||
* @param uriTemplateVariables uri template vars
|
||||
* @return {@code true} if the string matches against the pattern, or {@code false} otherwise.
|
||||
*/
|
||||
public boolean matchStrings(String str, Map<String, String> uriTemplateVariables) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user