Interface View<Input,Output>

All Known Subinterfaces:
AdminConnectionView<Input,Output>, ConnectionView<I,O>

public interface View<Input,Output>

Function which supports a polymorphic view of one class as another

Since:
2.2
Version:
2.2
Author:
Michael Grove
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
    Exception to indicate the reason a view failed.
  • Method Summary

    Modifier and Type
    Method
    Description
    as(Input theV)
    Transform the object into the new view.
    boolean
    canView(Input theInput, Class<Output> theView)
    Return whether or not the provided type of object can be viewed as the desired type.
  • Method Details

    • as

      Output as(Input theV) throws View.ViewException
      Transform the object into the new view.
      Parameters:
      theV - the object to change
      Returns:
      the view of the object
      Throws:
      View.ViewException - if there was an error changing the view of the object.
    • canView

      boolean canView(Input theInput, Class<Output> theView)
      Return whether or not the provided type of object can be viewed as the desired type. If true, calls to as(Input) will always succeed.
      Parameters:
      theInput - the type of the object whose view is to be changed
      theView - the type of view we want.
      Returns:
      true if the object can be viewed as the view class, false otherwise.