@Component public class GraphQLUtil extends Object
| Constructor and Description |
|---|
GraphQLUtil() |
| Modifier and Type | Method and Description |
|---|---|
<I> List<I> |
iterableConcreteClassToListInterface(Iterable<? extends I> iterable)
|
<I> List<I> |
iterableToList(Iterable<I> iterable)
|
<T> T |
optionalToObject(Optional<T> optional)
Transform an
Optional, as returned by Spring Data repositories, into a standard Java, which is null if
there is no value. |
public <I> List<I> iterableToList(Iterable<I> iterable)
Iterable (which can be a List), into a List of items of the same type. It's
usefull to transform the native type from Spring Data repositories (which needs concrete class to map into) into
the list of relevant GraphQL interfaceI - iterable - public <I> List<I> iterableConcreteClassToListInterface(Iterable<? extends I> iterable)
Iterable (which can be a List) of a concrete class, into a List of the I
interface or superclass. It's usefull to transform the native type from Spring Data repositories (which needs
concrete class to map into) into the list of relevant GraphQL interfaceI - iterable - Copyright © 2019. All rights reserved.