@ThreadSafe public final class PhotonPathMapper extends Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
containsMappings() |
static Map<String,String> |
getApplicationIDToPathMap() |
static String |
getDefaultApplicationID() |
static String |
getPathOfApplicationID(String sApplicationID)
Get the path mapped to the specified application ID
|
static String |
getPathOfApplicationIDOrDefault(String sApplicationID)
Get the path mapped to the specified application ID or (if no such
application ID is present) return the path of the default application ID
|
static String |
getPathOfDefaultApplicationID()
Get the path mapped to the default application ID
|
static com.helger.commons.state.EChange |
removeAllPathMappings()
Remove all contained path mappings (clearing).
|
static com.helger.commons.state.EChange |
removePathMapping(String sApplicationID)
Remove the path mapped to the specified application ID.
|
static void |
setDefaultApplicationID(String sApplicationID)
Set the default application ID.
|
static void |
setPathMapping(String sApplicationID,
String sPath)
Set a path mapping.
|
public static void setPathMapping(@Nonnull @Nonempty String sApplicationID, @Nonnull @Nonempty String sPath)
sApplicationID - Application ID to use. May neither be null nor empty.sPath - The path to use. May neither be null nor empty. Must
start with a "slash" but may not end with a slash. Valid example is
e.g. /public@Nonnull public static com.helger.commons.state.EChange removePathMapping(@Nullable String sApplicationID)
null.sApplicationID - Application ID to be removed. May be null.EChange.CHANGED if the path was successfully removed@Nonnull public static com.helger.commons.state.EChange removeAllPathMappings()
EChange.CHANGED if at least one path was removed,
EChange.UNCHANGED otherwise.@Nullable public static String getPathOfApplicationID(@Nullable String sApplicationID)
sApplicationID - Application ID to check. May be null.null if no mapping was found. A path starting with a
slash but not ending with a slash otherwise.@Nonnull @ReturnsMutableCopy public static Map<String,String> getApplicationIDToPathMap()
null.public static boolean containsMappings()
true if mappings are already defined,
false otherwise.public static void setDefaultApplicationID(@Nonnull @Nonempty String sApplicationID)
sApplicationID - The application ID to set as the default. May neither be
null nor empty.setPathMapping(String, String),
getDefaultApplicationID()@Nullable public static String getDefaultApplicationID()
null if not set.setDefaultApplicationID(String)@Nullable public static String getPathOfDefaultApplicationID()
null if no default application ID is set. A path
starting with a slash but not ending with a slash otherwise.getDefaultApplicationID()@Nullable public static String getPathOfApplicationIDOrDefault(@Nullable String sApplicationID)
sApplicationID - Application ID to check. May be null.null if no mapping was found and no default path is
specified. A path starting with a slash but not ending with a slash
otherwise.getPathOfApplicationID(String),
getPathOfDefaultApplicationID()Copyright © 2014–2015 Philip Helger. All rights reserved.