com.atlassian.jira.upgrade.tasks.util
Class FindMixedCaseUsernames

java.lang.Object
  extended by com.atlassian.jira.upgrade.tasks.util.FindMixedCaseUsernames

public class FindMixedCaseUsernames
extends Object

Factory for various consumers that are handy in upgrade tasks that need to force old username references to lowercase. Null values are tolerated/ignored, and an internal cache is used to reduce redundant effort where possible.


Constructor Summary
FindMixedCaseUsernames()
           
 
Method Summary
static EntityListConsumer<org.ofbiz.core.entity.GenericValue,Map<String,String>> fromColumn(String columnName)
          Consumer that returns a map of mixed-case usernames that were found from a Select.columns(String...) query to their lowercase equivalents.
static EntityListConsumer<org.ofbiz.core.entity.GenericValue,Map<String,List<Long>>> fromColumnAndReturnIds(String columnName)
          Consumer that returns a map of lowercase versions of the mixed-case usernames that were found from a Select.columns(String...) query to a list of the associated entity IDs for the rows that contained a mixed-case username.
static EntityListConsumer<String,Map<String,String>> fromStrings()
          Consumer that returns a map of mixed-case usernames that were found from a Select.distinctString(String) query to their lowercase equivalents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FindMixedCaseUsernames

public FindMixedCaseUsernames()
Method Detail

fromStrings

public static EntityListConsumer<String,Map<String,String>> fromStrings()
Consumer that returns a map of mixed-case usernames that were found from a Select.distinctString(String) query to their lowercase equivalents.

The resulting map might, for example, have a key of "Fred" with a corresponding value of "fred".


fromColumn

public static EntityListConsumer<org.ofbiz.core.entity.GenericValue,Map<String,String>> fromColumn(String columnName)
Consumer that returns a map of mixed-case usernames that were found from a Select.columns(String...) query to their lowercase equivalents. The column list must include the same columnName, but need not include any others.

The resulting map might, for example, have a key of "Fred" with a corresponding value of "fred".


fromColumnAndReturnIds

public static EntityListConsumer<org.ofbiz.core.entity.GenericValue,Map<String,List<Long>>> fromColumnAndReturnIds(String columnName)
Consumer that returns a map of lowercase versions of the mixed-case usernames that were found from a Select.columns(String...) query to a list of the associated entity IDs for the rows that contained a mixed-case username. The column list must include the same columnName and "id", but need not include any others.

The resulting map might, for example, have a key of "fred" with a corresponding value list of [10100, 10300, 10201, 10210, 10200]. The list should not be assumed to be in any particular order.



Copyright © 2002-2013 Atlassian. All Rights Reserved.