Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
sispub
openbis
Commits
30c73131
Commit
30c73131
authored
17 years ago
by
felmer
Browse files
Options
Downloads
Patches
Plain Diff
allow any Iterable as argument of createBeanList() methods
SVN: 1722
parent
07bb6e2a
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/source/java/ch/systemsx/cisd/common/utilities/BeanUtils.java
+7
-7
7 additions, 7 deletions
...rce/java/ch/systemsx/cisd/common/utilities/BeanUtils.java
with
7 additions
and
7 deletions
common/source/java/ch/systemsx/cisd/common/utilities/BeanUtils.java
+
7
−
7
View file @
30c73131
...
...
@@ -153,38 +153,38 @@ public final class BeanUtils
* Creates a new list of Beans of type <var>clazz</var>.
*
* @param clazz element type of the new list.
* @param source
List
The
list
to fill the new bean list from. Can be <code>null</code>, in which case the method
* @param source The
iterable
to fill the new bean list from. Can be <code>null</code>, in which case the method
* returns <code>null</code>.
* @return The new list filled from <var>sourceList</var> or <code>null</code>, if <var>sourceList</var> is
* <code>null</code>.
*/
public
final
static
<
T
,
S
>
List
<
T
>
createBeanList
(
Class
<
T
>
clazz
,
List
<
S
>
source
List
)
public
final
static
<
T
,
S
>
List
<
T
>
createBeanList
(
Class
<
T
>
clazz
,
Iterable
<
S
>
source
)
{
return
createBeanList
(
clazz
,
source
List
,
null
);
return
createBeanList
(
clazz
,
source
,
null
);
}
/**
* Creates a new list of Beans of type <var>clazz</var>.
*
* @param clazz element type of the new list.
* @param source
List
The
list
to fill the new bean list from. Can be <code>null</code>, in which case the method
* @param source The
iterable
to fill the new bean list from. Can be <code>null</code>, in which case the method
* returns <code>null</code>.
* @param converter The {@link Converter} to use to perform non-standard conversions when filling the bean. Can be
* <code>null</code>, in which case only standard conversions are allowed.
* @return The new list filled from <var>sourceList</var> or <code>null</code>, if <var>sourceList</var> is
* <code>null</code>.
*/
public
final
static
<
T
,
S
>
List
<
T
>
createBeanList
(
Class
<
T
>
clazz
,
List
<
S
>
source
List
,
Converter
converter
)
public
final
static
<
T
,
S
>
List
<
T
>
createBeanList
(
Class
<
T
>
clazz
,
Iterable
<
S
>
source
,
Converter
converter
)
{
assert
clazz
!=
null
;
if
(
source
List
==
null
)
if
(
source
==
null
)
{
return
null
;
}
final
List
<
T
>
resultList
=
new
ArrayList
<
T
>();
for
(
S
element
:
source
List
)
for
(
S
element
:
source
)
{
resultList
.
add
(
BeanUtils
.
createBean
(
clazz
,
element
,
converter
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment