Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package io.oasp.module.beanmapping.common.api;
 
 import java.util.List;
 import java.util.Set;

This is the interface used to convert from one Java bean to another compatible bean (e.g. from a JPA entity to a corresponding transfer-object).

Author(s):
hohwille
public interface BeanMapper {

  
Recursively converts the given source java.lang.Object to the given target java.lang.Class.

Parameters:
<T> is the generic type to convert to.
source is the object to convert.
targetClass is the java.lang.Class reflecting the type to convert to.
Returns:
the converted object. Will be null if source is null.
  <T> T map(Object sourceClass<T> targetClass);

  
Creates a new java.util.List with the mapped bean for each entry of the given java.util.List.

Parameters:
<T> is the generic type to convert the java.util.List entries to.
source is the java.util.List with the source objects.
targetClass is the java.lang.Class reflecting the type to convert each java.util.List entry to.
Returns:
the java.util.List with the converted objects. Will be empty is source is empty or null.
  <T> List<T> mapList(List<?> sourceClass<T> targetClass);

  
Creates a new java.util.Set with the mapped bean for each entry of the given java.util.Set.

Parameters:
<T> is the generic type to convert the java.util.Set entries to.
source is the java.util.Set with the source objects.
targetClass is the java.lang.Class reflecting the type to convert each java.util.Set entry to.
Returns:
the java.util.Set with the converted objects. Will be empty is source is empty or null.
  <T> Set<T> mapSet(Set<?> sourceClass<T> targetClass);
New to GrepCode? Check out our FAQ X