Interface BackingData

All Known Implementing Classes:
BackingData.Empty, Choices, ExpressionScope

public interface BackingData

Interface for some data that 'backs' a particular question. Can be used to provide survey specific options for a question where perhaps the project alone is not a good enough reference.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    empty(Class<?> type)
     
     
    default <T extends BackingData>
    Optional<T>
    isA(Class<T> implementation)
    Functional style casting method for returning an Optional of the desired BackingData type.
    default boolean
     
  • Method Details

    • empty

      static BackingData empty(Class<?> type)
      Returns:
      an instance of empty BackingData for the type - use this in place of null to signal there is no BackingData.
    • isEmpty

      default boolean isEmpty()
      Returns:
      true if the this backing data is empty, i.e there is no backing data.
    • getParameterType

      Class<?> getParameterType()
      Returns:
      the class which corresponds to Question.getParameterType() this backing data. Mostly used for assertions and type safety checks in generic code.
    • isA

      default <T extends BackingData> Optional<T> isA(Class<T> implementation)

      Functional style casting method for returning an Optional of the desired BackingData type.