Making Attribute Lowercase

John C. Pfeifer pfeifer at umd.edu
Wed Sep 27 08:28:43 EDT 2017


I have used iterators in this sort of situation:

iterator = cn.getValues().iterator();
while (iterator.hasNext()) {
    value = iterator.next();
    lcn.addValue(value.toLowerCase());
}

> On Sep 26, 2017, at 5:02 PM, McKean, Brandon Scott - mckeanbs <mckeanbs at jmu.edu> wrote:
> 
> Ok, is something like this instead would be safer?
> 
> var value = cn.getNativeAttribute().getValues();
> value = value[0];
> value = value.getValue();
> lcn.addValue(value.toLowerCase());
> 
> As far as I can tell I'm using methods that are safe to assume are there.
> 
> --
> Brandon McKean
> IT / Systems
> Linux Administrator
> (540)568-4235
> 
> From: users <users-bounces at shibboleth.net> on behalf of Cantor, Scott <cantor.2 at osu.edu>
> Sent: Tuesday, September 26, 2017 4:17:02 PM
> To: Shib Users
> Subject: Re: Making Attribute Lowercase
>  
> On 9/26/17, 4:11 PM, "users on behalf of McKean, Brandon Scott - mckeanbs" <users-bounces at shibboleth.net on behalf of mckeanbs at jmu.edu> wrote:
> 
> > Is that the sort of approach you're referring to?
> 
> Technically that's unsafe because it's depending on the underlying object implementing (probably) List but the actual getValues() method returns Collection, which doesn't itself implement get().
> 
> That's why I said using getValues() has limitations whereas getNativeAttribute().getValues() is a List but has other complications to account for.
> 
> -- Scott
> 
> 
> -- 
> To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net
> -- 
> To unsubscribe from this list send an email to users-unsubscribe at shibboleth.net


//
John Pfeifer
Division of Information Technology
University of Maryland, College Park



More information about the users mailing list