Package org.ametys.runtime.model
Class DefinitionContext
- java.lang.Object
-
- org.ametys.runtime.model.DefinitionContext
-
public final class DefinitionContext extends Object
Object that gives some context for definitions manipulation
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<Object>
getObject()
Retrieves the context object for the definitionboolean
isEdition()
Checks if the context is in editionstatic DefinitionContext
newInstance()
Creates a new instance of aDefinitionContext
DefinitionContext
withEdition(boolean isEdition)
Set totrue
if the context is in edition (default tofalse
)DefinitionContext
withObject(Object object)
Set the context object
-
-
-
Method Detail
-
newInstance
public static DefinitionContext newInstance()
Creates a new instance of aDefinitionContext
- Returns:
- the created instance
-
getObject
public Optional<Object> getObject()
Retrieves the context object for the definition- Returns:
- the context object
-
withObject
public DefinitionContext withObject(Object object)
Set the context object- Parameters:
object
- the context object to set- Returns:
- the current
DefinitionContext
-
isEdition
public boolean isEdition()
Checks if the context is in edition- Returns:
true
if the context is in edition,false
otherwise
-
withEdition
public DefinitionContext withEdition(boolean isEdition)
Set totrue
if the context is in edition (default tofalse
)- Parameters:
isEdition
-true
if the context is in edition,false
otherwise- Returns:
- the current
DefinitionContext
-
-