Class DefaultContributionModel<C extends Contribution>

    • Constructor Detail

      • DefaultContributionModel

        protected DefaultContributionModel​(C contribution)
    • Method Detail

      • filterByType

        public FilterByType filterByType​(String property,
                                         Object... parameters)
        Description copied from interface: ContributionModel
        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).

        Specified by:
        filterByType in interface ContributionModel
        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

        public <T> T getProperty​(String property,
                                 Object... parameters)
        Description copied from interface: ContributionModel
        Gets the value of the specified business property. The property can accept zero, one or more parameters.
        Specified by:
        getProperty in interface ContributionModel
        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.
      • getByReflection

        protected <T> T getByReflection​(String property,
                                        Object... parameters)
        Gets by reflection the value of the specified property of the underlying modelled contribution.
        Type Parameters:
        T - the type of the property value.
        Parameters:
        property - the property to get.
        parameters - some parameters useful for property value computation.
        Returns:
        the value of the property