Interface ContributionModel

  • All Known Implementing Classes:
    CalendarEventModel, DefaultContributionModel, PublicationDetailModel

    public interface ContributionModel
    Model of a contribution. A model is an object representing the business abstraction of a concrete type of contribution. It provides an interface to access in a more generic way the different business properties of the represented contribution without having to be explicitly known. Business properties mean here the whole interface describing the behaviour of the object.
    Author:
    mmoquillon
    • Method Detail

      • filterByType

        Filter<Class<?>,​Object> filterByType​(String property,
                                                   Object... parameters)
        Applies a filter on the type of the value of the specified business property. If the property value is null, then no filtering is applied.

        This method is useful to apply a specific treatment according to the type of the property (in the case the property can be of different type or the property represents a more generic business concept that can have different types according to the business context).

        Parameters:
        property - the name of a business property of the represented contribution.
        parameters - some parameters useful for property value computation.
        Returns:
        a filter by the type of the property.
      • getProperty

        <T> T getProperty​(String property,
                          Object... parameters)
        Gets the value of the specified business property. The property can accept zero, one or more parameters.
        Type Parameters:
        T - the expected type of the property value.
        Parameters:
        property - the name of the business property of the represented contribution.
        parameters - optionally some parameters required to select the correct value of the property
        Returns:
        the value of the asked business property.