public abstract class Completable extends Object
completed
status, allowing objects to
differentiate between an initialization phase and their final value. This
implementation is synchronized.
Each getter is recommended to call #complete()
, while
#throwIfCompleted()
must be called prior to object modification.
Before using Completable
think about using either a non-modifiable
constructor or a builder class.
Constructor and Description |
---|
Completable() |
Modifier and Type | Method and Description |
---|---|
protected void |
complete()
Finishes the objects initialization phase.
|
boolean |
isCompleted()
Completed status
|
protected void |
throwIfCompleted()
In case the object has already been completed a
CompletedException is
thrown. |
protected void complete()
This method is recommended to be called by each getter.
protected void throwIfCompleted()
CompletedException
is
thrown. Else nothing happens.
This method must be called by prior to object modification.
CompletedException
- if object is completedpublic boolean isCompleted()
Copyright © 2025. All rights reserved.