Package de.xima.fc.mdl
Class WorkspaceScope
java.lang.Object
de.xima.fc.mdl.WorkspaceScope
- All Implemented Interfaces:
Serializable
A workspace scope in formcycle, either the system scope or a
client scope. The system scope could
also be represented as a value of type Mandant that is set to null, but that has several
disadvantages, such as an increased risk of null pointer exceptions in general, and the
limited interoperability with new Collection APIs that disallow null values. This class provides
an abstraction around system and client scopes that does not expose null values explicitly.- Since:
- 8.0.0
- Author:
- XIMA MEDIA GmbH
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic WorkspaceScopeGets a workspace scope instance for a client.booleanGets the client if this scope is a client scope.inthashCode()booleanWhether this scope represents a client scope.booleanWhether this scope represents the system scope.static WorkspaceScopeGets 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.toString()
-
Method Details
-
equals
-
getClient
Gets the client if this scope is a client scope.- Returns:
- The client if this scope represents a
client scope, empty otherwise.
-
hashCode
public int hashCode() -
isClientScope
public boolean isClientScope()Whether this scope represents a client scope.- Returns:
trueif this scope represents a client scope,falseotherwise.
-
isSystemScope
public boolean isSystemScope()Whether this scope represents the system scope.- Returns:
trueif this scope represents the system scope,falseotherwise.
-
toString
-
client
Gets a workspace scope instance for a client.- Parameters:
client- Client scope.- Returns:
- A new workspace scope for the given client.
-
of
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 ornullfor the system scope.- Returns:
- The system workspace scope.
-
system
Gets the workspace scope instance for the system scope.- Returns:
- The system workspace scope.
-