private static Set < String > mergeDecision ( final LdapAttribute ldapConsent , final ConsentDecision decision ) { if ( decision . getId ( ) < 0 ) { decision . setId ( System . currentTimeMillis ( ) ) ; } if ( ldapConsent != null ) { val result = removeDecision ( ldapConsent , decision . getId ( ) ) ; val json = mapToJson ( decision ) ; if ( StringUtils . isBlank ( json ) ) { throw new IllegalArgumentException ( "Could not map consent decision to JSON" ) ; } result . add ( json ) ; LOGGER . debug ( "Merged consent decision [{}] with LDAP attribute [{}]" , decision , ldapConsent . getName ( ) ) ; return CollectionUtils . wrap ( result ) ; } val result = new HashSet < String > ( ) ; val json = mapToJson ( decision ) ; if ( StringUtils . isBlank ( json ) ) { throw new IllegalArgumentException ( "Could not map consent decision to JSON" ) ; } result . add ( json ) ; return result ; }
Merges a new decision into existing decisions . Decisions are matched by ID .