-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
标识 com.feilong.context.converter.StringToBeanConverter接口
@FunctionalInterface fix #741 com.feilong.context.converter.StringToBeanConverter接口移动到 feilong-core包 路径保持不变 fix #740 com.feilong.core.lang.StringUtil.toSingleValueMap(String, Class<T>, Class<V>) 要支持定制转换value类 fix #738
- Loading branch information
1 parent
a203683
commit c26f5bb
Showing
6 changed files
with
417 additions
and
106 deletions.
There are no files selected for viewing
92 changes: 47 additions & 45 deletions
92
...text/converter/StringToBeanConverter.java → ...text/converter/StringToBeanConverter.java
100755 → 100644
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,45 +1,47 @@ | ||
/* | ||
* Copyright (C) 2008 feilong | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.feilong.context.converter; | ||
|
||
/** | ||
* 将字符串转成 bean 的转换器. | ||
* | ||
* <p> | ||
* 功能和{@link org.apache.commons.collections4.Transformer} 类似,但是更专业和具体 | ||
* </p> | ||
* | ||
* @author <a href="https://github.com/ifeilong/feilong">feilong</a> | ||
* @param <T> | ||
* the generic type | ||
* @see org.apache.commons.collections4.Transformer | ||
* @see "org.springframework.core.convert.converter.Converter" | ||
* @see "org.springframework.core.convert.support.StringToEnumConverterFactory" | ||
* @since 1.8.3 | ||
* @since 1.11.2 rename from AbstractParse | ||
*/ | ||
public interface StringToBeanConverter<T> { | ||
|
||
/** | ||
* 转换. | ||
* | ||
* @param value | ||
* the value | ||
* @return 如果 <code>value</code> 是null或者empty,返回 null<br> | ||
*/ | ||
T convert(String value); | ||
|
||
} | ||
/* | ||
* Copyright (C) 2008 feilong | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package com.feilong.context.converter; | ||
|
||
/** | ||
* 将字符串转成 bean 的转换器. | ||
* | ||
* <p> | ||
* 功能和{@link org.apache.commons.collections4.Transformer} 类似,但是更专业和具体 | ||
* </p> | ||
* | ||
* @author <a href="https://github.com/ifeilong/feilong">feilong</a> | ||
* @param <T> | ||
* the generic type | ||
* @see org.apache.commons.collections4.Transformer | ||
* @see "org.springframework.core.convert.converter.Converter" | ||
* @see "org.springframework.core.convert.support.StringToEnumConverterFactory" | ||
* @since 1.8.3 | ||
* @since 1.11.2 rename from AbstractParse | ||
* @since 4.1.2 move from feilong-context | ||
*/ | ||
@FunctionalInterface | ||
public interface StringToBeanConverter<T> { | ||
|
||
/** | ||
* 转换. | ||
* | ||
* @param value | ||
* the value | ||
* @return 如果 <code>value</code> 是null或者empty,返回 null<br> | ||
*/ | ||
T convert(String value); | ||
|
||
} |
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.