Class TypoInspector

    • Constructor Detail

      • TypoInspector

        public TypoInspector​(BeaTunes beaTunes,
                             String propertyName)
        Sets up collator.
        Parameters:
        beaTunes - beaTunes
        propertyName - the name of the property that should be checked for typos
    • Method Detail

      • getCategory

        public String getCategory()
        Description copied from class: Inspector
        Indicates the inspection's category or grouping. By default this returns GENERAL.
        Overrides:
        getCategory in class Inspector
        Returns:
        category, by default General
      • getPropertyName

        public String getPropertyName()
        Description copied from class: Inspector
        Indicates which property is inspected by this inspector. This will be used when highlighting said property in views of a song that has issues.
        Specified by:
        getPropertyName in class Inspector
        Returns:
        property name
      • getMostUsedAttribute

        protected String getMostUsedAttribute​(List<String> similarAttributes)
      • getAffectedSongIds

        protected Set<Long> getAffectedSongIds​(List<String> similarAttributes)
      • exclude

        protected boolean exclude​(TypoInspector.Attribute attribute1,
                                  TypoInspector.Attribute attribute2)
        Allows subclasses to specify specific excludes.
        Parameters:
        attribute1 - attribute 1
        attribute2 - attribute 2
        Returns:
        true, if the attribute should be excluded as a cause for an issue. default is false
      • createIssue

        protected abstract Issue createIssue​(List<String> similarAttributes)
        Creates an issue for a possible typo.
        Parameters:
        similarAttributes - attributes that these songs have in common
        Returns:
        an issue