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 WorkspaceScope
Gets a workspace scope instance for a client.boolean
Gets the client if this scope is a client scope.int
hashCode()
boolean
Whether this scope represents a client scope.boolean
Whether this scope represents the system scope.static WorkspaceScope
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 WorkspaceScope
system()
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:
true
if this scope represents a client scope,false
otherwise.
-
isSystemScope
public boolean isSystemScope()Whether this scope represents the system scope.- Returns:
true
if this scope represents the system scope,false
otherwise.
-
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 ornull
for the system scope.- Returns:
- The system workspace scope.
-
system
Gets the workspace scope instance for the system scope.- Returns:
- The system workspace scope.
-