cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
458
Views
0
Helpful
1
Replies

ContextServiceClient's searchAndDecrypt() method signature

joshorva
Cisco Employee
Cisco Employee

Are we sure that we have correctly defined the signature for searchAndDecrypt(). It currently looks like this:

<T extends BaseDbBean>
List<T>
searchAndDecrypt(Class<T> classType, Map<String,String> searchParams, Operation op)

Searches for all objects matching the search params for the API.

Although we actually prepare a searchParams Map that is defined as follows (see MultivaluedMap (Java(TM) EE 7 Specification APIs)):

Map < String >, List < String > >

The current signature forces us to use a special MultivaluedMap that seems to do a bit of trickery with the "value" of a "key" in a Map. I'd like to suggest that the signature of this method be changed to the following:

< T extends BaseDbBean >
List < T >
searchAndDecrypt (Class < T > classType, Map < String, List < String > > searchParams, Operation op)

Searches for all objects matching the search params for the API.

This would allow the following bit of code to work:

            final String fieldSetName = "FIELD_SET_A";

            final Map < String, List < String > > p = new HashMap < String, List < String > > ();

            p.put ("id", Arrays.asList (fieldSetName));

            final List < FieldSet > fieldSets = contextServiceClient.searchAndDecrypt (FieldSet.class, p, Operation.OR);


Or am I misinterpreting something?

1 Accepted Solution

Accepted Solutions

ccosenti
Level 1
Level 1

Hi Joseph,

We've passed this along to the design team. Thanks for the feedback!

View solution in original post

1 Reply 1

ccosenti
Level 1
Level 1

Hi Joseph,

We've passed this along to the design team. Thanks for the feedback!