public interface VariantManager
WARNING: Variant management is not thread safe and should never be done will an other thread read from or write to
an already existing variant. The classical pattern for multi-variant processing is to pre-allocate variants and
call allowVariantMultiThreadAccess(boolean)
to allow multi-thread access on main thread, work on variants from other
threads (be carefull to only write concurrently attributes flagged as dependent to variant in the Javadoc) and then
remove variants from main thread once work is over.
Modifier and Type | Method and Description |
---|---|
void |
allowVariantMultiThreadAccess(boolean allow)
Allows variants to be accessed simulaneously by different threads.
|
void |
cloneVariant(String sourceVariantId,
List<String> targetVariantIds)
Create a new variant by cloning an existing one.
|
void |
cloneVariant(String sourceVariantId,
List<String> targetVariantIds,
boolean mayOverwrite)
Create or overwrite a variant by cloning an existing one.
|
void |
cloneVariant(String sourceVariantId,
String targetVariantId)
Create a new variant by cloning an existing one.
|
void |
cloneVariant(String sourceVariantId,
String targetVariantId,
boolean mayOverwrite)
Create or overwrite a variant by cloning an existing one.
|
Collection<String> |
getVariantIds()
Get the variant id list.
|
String |
getWorkingVariantId()
Get the working variant.
|
boolean |
isVariantMultiThreadAccessAllowed()
Get the allowed multithread access state .
|
void |
removeVariant(String variantId)
Remove a variant.
|
void |
setWorkingVariant(String variantId)
Set the working variant.
|
Collection<String> getVariantIds()
String getWorkingVariantId()
void setWorkingVariant(String variantId)
variantId
- the id of the working variantPowsyblException
- if the variant is not foundvoid cloneVariant(String sourceVariantId, List<String> targetVariantIds)
sourceVariantId
- the source variant idtargetVariantIds
- the target variant id list (the ones that will be created)PowsyblException
- if the source variant is not found or if a variant with
an id of targetStateIds already existsvoid cloneVariant(String sourceVariantId, List<String> targetVariantIds, boolean mayOverwrite)
sourceVariantId
- the source variant idtargetVariantIds
- the target variant id list (the ones that will be created/overwritten)mayOverwrite
- indicates if the target can be overwritten when it already existsPowsyblException
- if a variant with an id of targetVariantIds already exists and
the mayOverwrite parameter is set to false
void cloneVariant(String sourceVariantId, String targetVariantId)
sourceVariantId
- the source variant idtargetVariantId
- the target variant id (the one that will be created)PowsyblException
- if the source variant is not found or if a variant with
the id targetVariantId already existsvoid cloneVariant(String sourceVariantId, String targetVariantId, boolean mayOverwrite)
sourceVariantId
- the source variant idtargetVariantId
- the target variant id list (the one that will be created/overwritten)mayOverwrite
- indicates if the target can be overwritten when it already existsPowsyblException
- * if a variant with the id of targetVariantId already exists and
* the mayOverwrite parameter is set to false
void removeVariant(String variantId)
variantId
- the id of the variant to removevoid allowVariantMultiThreadAccess(boolean allow)
allow
- boolean isVariantMultiThreadAccessAllowed()
Copyright © 2020. All rights reserved.