Class CorrelationIdentifier
- java.lang.Object
-
- com.apple.foundationdb.record.query.plan.temp.CorrelationIdentifier
-
@API(EXPERIMENTAL) public class CorrelationIdentifier extends Object
A correlation identifier is an immutable object that is created with a string uniquely identifying it.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
String
getId()
int
hashCode()
static Map<CorrelationIdentifier,CorrelationIdentifier>
identityMappingMap(Set<CorrelationIdentifier> aliases)
Return a mapping betweena -> a
for all a in the given set as a view on the original set.static CorrelationIdentifier
of(String id)
Create a new correlation identifier using the given string.String
toString()
Returns the backing string id.static CorrelationIdentifier
uniqueID()
Create a new correlation identifier.static CorrelationIdentifier
uniqueID(Class<?> clazz)
Create a new correlation identifier.static CorrelationIdentifier
uniqueID(Class<?> clazz, String prefix)
Create a new correlation identifier.
-
-
-
Method Detail
-
of
@Nonnull public static CorrelationIdentifier of(@Nonnull String id)
Create a new correlation identifier using the given string. It is the callers responsibility to only use unique string values in order to avoid clashes.- Parameters:
id
- the identifier string- Returns:
- a new
CorrelationIdentifier
-
uniqueID
@Nonnull public static CorrelationIdentifier uniqueID()
Create a new correlation identifier. The returned correlation identifier can be assumed to be unique.- Returns:
- a new unique
CorrelationIdentifier
-
uniqueID
@Nonnull public static CorrelationIdentifier uniqueID(@Nonnull Class<?> clazz)
Create a new correlation identifier. The returned correlation identifier can be assumed to be unique.- Parameters:
clazz
- to specify the kind of ewntity this identifier is going to be used for. This is really only useful if aDebugger
is set.- Returns:
- a new unique
CorrelationIdentifier
-
uniqueID
@Nonnull public static CorrelationIdentifier uniqueID(@Nonnull Class<?> clazz, @Nonnull String prefix)
Create a new correlation identifier. The returned correlation identifier can be assumed to be unique.- Parameters:
clazz
- to specify the kind of ewntity this identifier is going to be used for. This is really only useful if aDebugger
is set.prefix
- a prefix for the returned identifier- Returns:
- a new unique
CorrelationIdentifier
-
toString
public String toString()
Returns the backing string id.- Overrides:
toString
in classObject
- Returns:
- the string backing this
CorrelationIdentifier
-
identityMappingMap
public static Map<CorrelationIdentifier,CorrelationIdentifier> identityMappingMap(@Nonnull Set<CorrelationIdentifier> aliases)
Return a mapping betweena -> a
for all a in the given set as a view on the original set.- Parameters:
aliases
- set to compute the identity mappings for- Returns:
- a view on the set that maps each element in
aliases
to itself.
-
-