SMILA (incubation) API documentation

org.eclipse.smila.datamodel.id
Interface IdFactory

All Known Implementing Classes:
DefaultIdFactoryImpl

public interface IdFactory

Interface of factories for Ids and keys.

Author:
jschumacher

Field Summary
static IdFactory DEFAULT_INSTANCE
          The Id factory for default Id/key implementation.
 
Method Summary
 Id createId(java.lang.String source, Key key)
          create a new Id.
 Id createId(java.lang.String source, Key sourceKey, java.util.List<Key> elementKeys, java.util.List<java.lang.String> fragmentNames)
          create a complete Id with optional element keys and fragment names.
 Id createId(java.lang.String source, java.util.Map<java.lang.String,java.lang.String> keyValues)
          create an Id with a key created from the given name-value mapping.
 Id createId(java.lang.String source, java.lang.String simpleKeyValue)
          create an Id with a simple unnamed key.
 Id createId(java.lang.String source, java.lang.String simpleKeyName, java.lang.String simpleKeyValue)
          create an Id with a simple named key.
 Key createKey(java.util.Map<java.lang.String,java.lang.String> keyValues)
          create a key from the given name-value mapping.
 Key createKey(java.lang.String simpleKeyValue)
          create a simple unnamed key.
 Key createKey(java.lang.String simpleKeyName, java.lang.String simpleKeyValue)
          create a simple named key.
 

Field Detail

DEFAULT_INSTANCE

static final IdFactory DEFAULT_INSTANCE
The Id factory for default Id/key implementation.

Method Detail

createId

Id createId(java.lang.String source,
            Key key)
create a new Id.

Parameters:
source - data source name
key - key of object in data source
Returns:
record Id

createId

Id createId(java.lang.String source,
            java.lang.String simpleKeyValue)
create an Id with a simple unnamed key.

Parameters:
source - data source name
simpleKeyValue - key value
Returns:
record Id

createId

Id createId(java.lang.String source,
            java.lang.String simpleKeyName,
            java.lang.String simpleKeyValue)
create an Id with a simple named key.

Parameters:
source - data source name
simpleKeyName - key name
simpleKeyValue - key value
Returns:
record Id

createId

Id createId(java.lang.String source,
            java.util.Map<java.lang.String,java.lang.String> keyValues)
create an Id with a key created from the given name-value mapping. If the mapping contains only one key value, a simple key is created. Else it will be a composite key.

Parameters:
source - data source name
keyValues - name-value mapping for key
Returns:
record Id

createId

Id createId(java.lang.String source,
            Key sourceKey,
            java.util.List<Key> elementKeys,
            java.util.List<java.lang.String> fragmentNames)
create a complete Id with optional element keys and fragment names.

Parameters:
source - data source name
sourceKey - name-value mapping for key
elementKeys - container element keys. can be null or empty for non-container-element Ids
fragmentNames - fragment names, can be null or empty for non-fragment Ids
Returns:
record Id

createKey

Key createKey(java.lang.String simpleKeyValue)
create a simple unnamed key.

Parameters:
simpleKeyValue - key value
Returns:
simple unnamed key

createKey

Key createKey(java.lang.String simpleKeyName,
              java.lang.String simpleKeyValue)
create a simple named key.

Parameters:
simpleKeyName - key name
simpleKeyValue - key value
Returns:
simple named key

createKey

Key createKey(java.util.Map<java.lang.String,java.lang.String> keyValues)
create a key from the given name-value mapping. If the mapping contains only one key value, a simple key is created. Else it will be a composite key.

Parameters:
keyValues - name-value mapping for key
Returns:
composite key

SMILA (incubation) API documentation