Package de.xima.fc.mdl
Class WorkspaceScope
- java.lang.Object
- 
- de.xima.fc.mdl.WorkspaceScope
 
- 
- All Implemented Interfaces:
- Serializable
 
 public final class WorkspaceScope extends Object implements Serializable A workspace scope in formcycle, either the system scope or aclientscope. The system scope could also be represented as a value of typeMandantthat is set tonull, but that has several disadvantages, such as an increased risk ofnull pointer exceptionsin general, and the limited interoperability with newCollectionAPIs that disallownullvalues. This class provides an abstraction around system and client scopes that does not exposenullvalues explicitly.- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
- Serialized Form
 
- 
- 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static WorkspaceScopeclient(Mandant client)Gets a workspace scope instance for a client.booleanequals(Object obj)Optional<Mandant>getClient()Gets the client if this scope is a client scope.inthashCode()booleanisClientScope()Whether this scope represents a client scope.booleanisSystemScope()Whether this scope represents the system scope.static WorkspaceScopeof(Mandant scope)Gets a workspace scope instance for the given scope, either a client scope when the given client is non-null, or the system scope otherwise.static WorkspaceScopesystem()Gets the workspace scope instance for the system scope.StringtoString()
 
- 
- 
- 
Method Detail- 
getClientpublic Optional<Mandant> getClient() Gets the client if this scope is a client scope.- Returns:
- The client if this scope represents a client scope, empty otherwise.
 
 - 
isClientScopepublic boolean isClientScope() Whether this scope represents a client scope.- Returns:
- trueif this scope represents a client scope,- falseotherwise.
 
 - 
isSystemScopepublic boolean isSystemScope() Whether this scope represents the system scope.- Returns:
- trueif this scope represents the system scope,- falseotherwise.
 
 - 
clientpublic static WorkspaceScope client(Mandant client) Gets a workspace scope instance for a client.- Parameters:
- client- Client scope.
- Returns:
- A new workspace scope for the given client.
 
 - 
ofpublic static WorkspaceScope of(Mandant scope) Gets a workspace scope instance for the given scope, either a client scope when the given client is non-null, or the system scope otherwise.- Parameters:
- scope- A client scope or- nullfor the system scope.
- Returns:
- The system workspace scope.
 
 - 
systempublic static WorkspaceScope system() Gets the workspace scope instance for the system scope.- Returns:
- The system workspace scope.
 
 
- 
 
-