public class IdUtils extends Object
Provides utility methods related to ids.
| Modifier and Type | Method and Description | 
|---|---|
static void | 
assertTypedGlobalIdHasCorrectType(String globalId,
                                 String expectedType)
Assertion to check that a typed global id has the correct type 
 | 
static String | 
extractIdWithoutTypeInfo(String id)
Extracts the id without type info. 
 | 
static String | 
extractTypeNameFromGlobalId(String globalId)
Extracts the type name from the given global id. 
 | 
static String | 
getTypedGlobalId(String type,
                String baseId)
Assembles a type-encoded global id from the given entity type and base id. 
 | 
static boolean | 
hasTypeInformation(String idValue)
Checks whether the given ID value has type information (needed for a global ID value). 
 | 
static com.google.common.collect.ImmutableList<String> | 
transformIdentifiablesToIds(Collection<? extends Identifiable> identifiables)
Returns a list of the ids of the given identifiables. 
 | 
static com.google.common.collect.ImmutableList<String> | 
transformIdentifiablesToIdValues(Collection<? extends Identifiable> identifiables)
Returns a list of the values of the ids of the given identifiables. 
 | 
public static com.google.common.collect.ImmutableList<String> transformIdentifiablesToIdValues(Collection<? extends Identifiable> identifiables)
Returns a list of the values of the ids of the given identifiables.
identifiables - the identifiable to processpublic static com.google.common.collect.ImmutableList<String> transformIdentifiablesToIds(Collection<? extends Identifiable> identifiables)
Returns a list of the ids of the given identifiables.
identifiables - the identifiable to processpublic static String getTypedGlobalId(String type, String baseId)
Assembles a type-encoded global id from the given entity type and base id.
type - the entity typebaseId - the base idpublic static String extractTypeNameFromGlobalId(String globalId)
Extracts the type name from the given global id.
globalId - the global idpublic static String extractIdWithoutTypeInfo(String id)
Extracts the id without type info.
id - the idpublic static boolean hasTypeInformation(String idValue)
Checks whether the given ID value has type information (needed for a global ID value).
idValue - the ID value to be checkedtrue if a type information prefix is presentCopyright © 2010 - 2018 edorasware ag. All Rights Reserved.