Package com.yworkflow.common.tenant
Class TenantId
java.lang.Object
com.yworkflow.common.tenant.TenantId
Represents a tenant identifier in the yWorkflow system. TenantId is used for multi-tenancy
support, allowing the workflow engine to isolate workflow data and operations between different
tenants.
TenantId is an immutable value object that encapsulates a tenant identifier string. It provides type safety and validation for tenant identification throughout the workflow system.
Multi-tenancy is essential for SaaS applications where multiple organizations or customers share the same workflow engine instance. Each tenant's workflows, instances, and data are completely isolated from other tenants.
- Since:
- 1.0
- See Also:
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanCompares this TenantId with another object for equality.getValue()Returns the string value of this tenant ID.inthashCode()Returns the hash code for this TenantId based on its string value.static TenantIdCreates a new TenantId instance with the specified value.
-
Field Details
-
EMPTY
Represents an empty tenant ID, used when no specific tenant is specified. This is useful for single-tenant scenarios or when tenant information is not available.
-
-
Method Details
-
getValue
Returns the string value of this tenant ID.- Returns:
- the tenant identifier string
-
tenantId
Creates a new TenantId instance with the specified value. The value is validated to ensure it meets the requirements for tenant identifiers.- Parameters:
value- the tenant identifier string- Returns:
- a new TenantId instance
- Throws:
IllegalArgumentException- if the value is invalid
-
equals
Compares this TenantId with another object for equality. Two TenantId instances are equal if they have the same string value. -
hashCode
public int hashCode()Returns the hash code for this TenantId based on its string value.
-