private FormatPreferences tryEasy ( FormatPreferences preferences , boolean force ) { int count = 0 ; for ( Map . Entry < String , String > e : preferences . rawMap . entrySet ( ) ) { if ( ! "scan" . equalsIgnoreCase ( e . getValue ( ) ) ) count ++ ; } if ( force || count >= FormatPreferences . KEYS . size ( ) ) return preferences ; return null ; }
Checks validity of preferences and returns with a non - null value if ALL format keys are available thus negating the need for a scan .