Interface ViewBuilder<T>


  • public interface ViewBuilder<T>
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      T build​(java.lang.Object sourceObject)
      Creates a view for the given source object.
      ViewBuilder<T> mixInTo​(java.lang.Class<?> targetType, java.lang.Class<?> mixInType)
      Mixes the given type into all views of the given type created using build(Object).
      ViewBuilder<T> mixInTo​(java.lang.Class<?> targetType, java.lang.Object mixIn)
      Mixes the given object into all views of the given type created using build(Object).
    • Method Detail

      • mixInTo

        ViewBuilder<T> mixInTo​(java.lang.Class<?> targetType,
                               java.lang.Object mixIn)
        Mixes the given object into all views of the given type created using build(Object). Applied to all views reachable from created views. The mix-in object should be serializable. When a given method cannot be found on the source object for a view, the mix-in object is searched for a compatible method. For a getter method, the mix-in may also provide a method that takes the view as a parameter.
        Parameters:
        mixIn - the object to be mixed-in
        targetType - the target type
        Returns:
        this
      • mixInTo

        ViewBuilder<T> mixInTo​(java.lang.Class<?> targetType,
                               java.lang.Class<?> mixInType)
        Mixes the given type into all views of the given type created using build(Object). Applied to all views reachable from created views. An instance of the class is created for each view of the given type that is created. The class should have a constructor that accepts the view as a parameter. When a given method cannot be found on the source object for a view, the mix-in object is searched for a compatible method.
        Returns:
        this
      • build

        T build​(@Nullable
                java.lang.Object sourceObject)
        Creates a view for the given source object. Returns null when source object is null.