CollectionHelper.java revision 2210fc30709625f254e6a6d5dc89c3bfefa48816
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2006 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: CollectionHelper.java,v 1.6 2010/01/06 22:31:55 veiming Exp $
*
*/
/*
* Portions Copyrighted 2010-2014 ForgeRock AS
*/
/**
* This class contains various Collection manipulation methods.
*/
public class CollectionHelper {
/**
* Returns String from a map of string of set of string.
*
* @param map Map of string of set of string.
* @param name Key of the map entry.
* @return String from a map of string of set of string
*/
}
/**
* Returns String from a map of string of set of string.
*
* @param map Map of string of set of string.
* @param name Key of the map entry.
* @param defaultValue Default value if the string is not found.
* @return String from a map of string of set of string
*/
}
/**
* Gets a boolean attribute from a {@code Map<String, Set<String>>}, defaulting to the given default value if
* the attribute is not present.
*
* @param map the attribute map.
* @param name the name of the attribute to retrieve.
* @param defaultValue the value to use if the attribute is not present.
* @return the boolean value using {@link Boolean#parseBoolean(String)}.
*/
}
/**
* Returns integer value from a Map of String of Set of String.
*
* @param map Map of String of Set of String.
* @param name Kye of the map entry.
* @param defaultValue Default value if the integer value is not found.
* @param debug Debug object.
* @return integer value from a Map of String of Set of String.
*/
public static int getIntMapAttr(
) {
try {
} catch (NumberFormatException nfe) {
}
}
/**
* Returns integer value from a Map of String of Set of String.
*
* @param map Map of String of Set of String.
* @param name Key of the map entry.
* @param defaultValue Default value if the integer value is not found.
* @param debug Debug object.
* @return integer value from a Map of String of Set of String.
*/
public static int getIntMapAttr(
int defaultValue,
) {
try {
} catch (NumberFormatException nfe) {
return defaultValue;
}
}
/**
* This convenience method is for getting server specific attributes from a
* list attribute. Server specific is determined by prefixing a list
* attribute value with DSAME local server name followed by the | character.
* If the list has more than one entry but no matching local server prefixes
* than null is returned as this is an invalid configuration for these type
* of attributes. This allows services like authentication to support a
* geographic directory configuration.
*
* @param map Map of String of Set of String.
* @param attrName Key of the map entry of interest.
* @return the server name.
*/
}
return strServer;
}
) {
if (index != -1) {
} else {
}
} else {
}
}
}
}
return result;
}
/**
* This convenience method is for getting server specific attributes from a
* list attribute. Server specific is determined by prefixing a list
* attribute value with DSAME local server name followed by the | character.
* If the list has more than one entry but no matching local server prefixes
* than an empty Set is returned as this is an invalid configuration for
* these type of attributes. This allows services like authentication to
* support a geographic directory configuration.
*
* @param map Map of String of Set of String.
* @param attrName Key of the map entry of interest.
* @return attributes belonging to this server, or if there is only one
* attribute, then that
*/
}
return ret;
}
if (index != -1) {
}
}
}
}
return ret;
}
}