Know if a class implements a certain interface

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Know if a class implements a certain interface

hiedra

Hi,

How to know if a class implements a certain interface? Do you know any direct method?

 

Thx.

Hiedra.

Reply | Threaded
Open this post in threaded view
|

RE: Know if a class implements a certain interface

hiedra

Sorry, my head is gone .. getBeadByType

😝

 

De: Maria Jose Esteve <[hidden email]>
Enviado el: miércoles, 1 de julio de 2020 19:44
Para: [hidden email]
Asunto: Know if a class implements a certain interface

 

Hi,

How to know if a class implements a certain interface? Do you know any direct method?

 

Thx.

Hiedra.

Reply | Threaded
Open this post in threaded view
|

RE: Know if a class implements a certain interface

yishayw

It depends on what you want to check for. If you want to check that a component/strand has a certain bead, then yes, use getBeadByType(). If you want to check if myObj implements IMyInterface, then check

 

If (myObj is IMyInterface)

 

Hope that’s clear.

 

From: [hidden email]
Sent: Wednesday, July 1, 2020 8:50 PM
To: [hidden email]
Subject: RE: Know if a class implements a certain interface

 

Sorry, my head is gone .. getBeadByType

😝

 

De: Maria Jose Esteve <[hidden email]>
Enviado el: miércoles, 1 de julio de 2020 19:44
Para: [hidden email]
Asunto: Know if a class implements a certain interface

 

Hi,

How to know if a class implements a certain interface? Do you know any direct method?

 

Thx.

Hiedra.

 

Reply | Threaded
Open this post in threaded view
|

RE: Know if a class implements a certain interface

hiedra

Right, thanks Yishay

 

Hiedra.

 

De: Yishay Weiss <[hidden email]>
Enviado el: miércoles, 1 de julio de 2020 20:01
Para: [hidden email]
Asunto: RE: Know if a class implements a certain interface

 

It depends on what you want to check for. If you want to check that a component/strand has a certain bead, then yes, use getBeadByType(). If you want to check if myObj implements IMyInterface, then check

 

If (myObj is IMyInterface)

 

Hope that’s clear.

 

From: [hidden email]
Sent: Wednesday, July 1, 2020 8:50 PM
To:
[hidden email]
Subject: RE: Know if a class implements a certain interface

 

Sorry, my head is gone .. getBeadByType

😝

 

De: Maria Jose Esteve <[hidden email]>
Enviado el: miércoles, 1 de julio de 2020 19:44
Para: [hidden email]
Asunto: Know if a class implements a certain interface

 

Hi,

How to know if a class implements a certain interface? Do you know any direct method?

 

Thx.

Hiedra.