Package arez.component
Interface Identifiable<K>
- Type Parameters:
K
- the type of the id.
public interface Identifiable<K>
Interface implemented by components so that the underlying identifier can be exposed.
The
ArezId
is used by Arez classes when manipulating the component. As long as
Disposable.dispose()
has not been invoked on the component then the ArezId
value should be unique within the scope of the ArezContext
.-
Method Summary
Modifier and TypeMethodDescriptionstatic <K> Identifiable<K>
asIdentifiable
(Object object) Cast specified object to instance of Identifiable.Return the unique id of the component.static <K> K
Return the unique id of the object if it is Identifiable, else return null.
-
Method Details
-
getArezId
Return the unique id of the component. As long asDisposable.dispose()
has not been invoked on the component, the return value should be unique within the scope of theArezContext
.- Returns:
- the unique id of the component.
-
getArezId
Return the unique id of the object if it is Identifiable, else return null.- Type Parameters:
K
- the type of the id.- Parameters:
object
- the object to dispose.- Returns:
- the arez id if the object is Identifiable, otherwise null.
-
asIdentifiable
Cast specified object to instance of Identifiable. Invariant checks will verify that the cast is valid before proceeding.- Type Parameters:
K
- the type parameter for Identifiable.- Parameters:
object
- the object.- Returns:
- the object cast to Identifiable.
-