Package com.mxraven.admin
Class Entity<D>
java.lang.Object
com.mxraven.admin.Entity<D>
- Type Parameters:
D- the wire record backing this entity
- Direct Known Subclasses:
APIKey,AutoReplyTemplate,Domain,InboundRoute,Listener,RecipientSet,RecipientSetMember,SmtpForwardDestination,SmtpRelay,StorageIntegration,TenantIdentityProvider,TenantSuppression,WebhookEndpoint
Base for hydrated resource entities. An entity wraps the wire record
D with the client and path needed to act on the resource, plus local
delete state.
Reads return a snapshot; call reload() (where supported) for fresh
state. isDeleted() is local bookkeeping for deletes performed through
this instance — it cannot observe deletes made elsewhere.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedEntity(AdminClient client, String path, D data) Creates an entity bound to a client, path, and backing data.protectedEntity(AdminClient client, String path, D data, boolean deleted) Creates an entity bound to a client, path, backing data, and delete state. -
Method Summary
-
Field Details
-
client
The client used to issue requests for this entity. -
path
Client-relative path of this resource. -
data
Raw wire record backing this entity.
-
-
Constructor Details
-
Entity
Creates an entity bound to a client, path, and backing data.- Parameters:
client- admin client used for requestspath- resource pathdata- backing wire record
-
Entity
Creates an entity bound to a client, path, backing data, and delete state.- Parameters:
client- admin client used for requestspath- resource pathdata- backing wire recorddeleted- whether the entity is considered deleted
-
-
Method Details
-
data
The raw wire record backing this entity.- Returns:
- the underlying wire record
-
isDeleted
public boolean isDeleted()Whether this entity has been deleted through this instance. Local state only; not authoritative server state.- Returns:
trueif deleted through this instance
-
delete
Delete this resource. Idempotent: once this instance has deleted it, further calls are a local no-op.- Returns:
trueonce the resource has been deleted through this instance- Throws:
IOException- if the delete request fails or is interrupted
-
path
Returns the client-relative path of this resource.- Returns:
- the resource path
-