scrivito
Version:
Scrivito is a professional, yet easy to use SaaS Enterprise Content Management Service, built for digital agencies and medium to large businesses. It is completely maintenance-free, cost-effective, and has unprecedented performance and security.
30 lines (23 loc) • 578 B
text/typescript
export type ObjUnavailableReason = 'forbidden' | 'nonexistent' | 'notLoaded';
export class ObjUnavailable {
constructor(
private readonly _id: string,
private readonly _reason: ObjUnavailableReason,
) {}
id(): string {
return this._id;
}
isForbidden(): boolean {
return this._reason === 'forbidden';
}
isNonexistent(): boolean {
return this._reason === 'nonexistent';
}
isNotLoaded(): boolean {
return this._reason === 'notLoaded';
}
// For test purpose only.
reason(): ObjUnavailableReason {
return this._reason;
}
}