Class AbstractRatingExtension

    • Constructor Detail

      • AbstractRatingExtension

        public AbstractRatingExtension​(ExtensionRepository repository,
                                       ExtensionId id,
                                       String type)
        Parameters:
        repository - the repository where this extension comes from
        id - the extension identifier
        type - the extension type
      • AbstractRatingExtension

        public AbstractRatingExtension​(ExtensionRepository repository,
                                       Extension extension)
        Create new extension descriptor by copying provided one.
        Parameters:
        repository - the repository where this extension comes from
        extension - the extension to copy
    • Method Detail

      • getRating

        public ExtensionRating getRating()
        Specified by:
        getRating in interface Rating
        Returns:
        the total votes/average vote combination which represents an extension's rating
      • setRating

        public void setRating​(ExtensionRating rating)
        Parameters:
        rating - an extension's rating
      • get

        public <T> T get​(String fieldName)
        Description copied from class: AbstractExtension
        Get an extension field by name. Fallback on properties.
        Specified by:
        get in interface Extension
        Overrides:
        get in class AbstractRemoteExtension
        Type Parameters:
        T - type of the field value
        Parameters:
        fieldName - the field name;
        Returns:
        the field value or null if none could be found