src/main/java/de/blau/android/presets/PresetItem.java
/**
     * Checks the fixed tags belonging to this item exist in the given tags
     * 
     * Fields with MatchType.NONE will be ignored
     * 
     * @param tagSet Map containing tags to compare against this preset item
     * @return true if the tagSet matches (all the fixed fields need to be present)
     */
Checks the fixed tags belonging to this item exist in the given tags

Fields with MatchType.NONE will be ignored

@param tagSet Map containing tags to compare against this preset item
@return true if the tagSet matches (all the fixed fields need to be present)
Checks the fixed tags belonging to this item exist in the given tags Fields with MatchType . NONE will be ignored @param tagSet Map containing tags to compare against this preset item @return true if the tagSet matches ( all the fixed fields need to be present )
public boolean matches(@NonNull Map<String, String> tagSet) {
        int matchCount = 0;
        int fixedTagsCount = fixedTags.size();
        for (Entry<String, PresetFixedField> tag : fixedTags.entrySet()) { 
            PresetFixedField field = tag.getValue();
            if (field.matchType == MatchType.NONE) {
                fixedTagsCount--;
                continue;
            }
            String key = tag.getKey();
            if (field.getKey().equals(key)) {
                String value = tagSet.get(key);
                if (field.getValue().equals(value)) {
                    matchCount++;
                }
            }
        }
        return minMatch > 0 ? matchCount >= minMatch : matchCount == fixedTagsCount;
    }
public boolean matches ( @ NonNull Map < String , String > tagSet ) { int matchCount = 0 ; int fixedTagsCount = fixedTags . size ( ) ; for ( Entry < String , PresetFixedField > tag : fixedTags . entrySet ( ) ) { PresetFixedField field = tag . getValue ( ) ; if ( field . matchType == MatchType . NONE ) { fixedTagsCount -- ; continue ; } String key = tag . getKey ( ) ; if ( field . getKey ( ) . equals ( key ) ) { String value = tagSet . get ( key ) ; if ( field . getValue ( ) . equals ( value ) ) { matchCount ++ ; } } } return minMatch > 0 ? matchCount >= minMatch : matchCount == fixedTagsCount ; }
Checks the fixed tags belonging to this item exist in the given tags
Checks the fixed tags belonging to this item exist in the given tags
// for each own tag