Decision Management (ODM,ADS)

 View Only
Expand all | Collapse all

i would like to compare class object in ARL like ABClass.class.isInstance (this) but this is not compiling

  • 1.  i would like to compare class object in ARL like ABClass.class.isInstance (this) but this is not compiling

    Posted Fri February 16, 2024 06:07 PM

    I would like to compare class object in ARL in virtual method like

    if (this !=null){

    return ABClass.class.isInstance (this);

    }

     but this is not compiling . Any suggestion



    ------------------------------
    Ahmad Alam
    ------------------------------


  • 2.  RE: i would like to compare class object in ARL like ABClass.class.isInstance (this) but this is not compiling

    Posted Mon February 19, 2024 03:29 AM

    If it's not mandatory for you implement this in the B2X ARL, You can define in safely XOM like this:

    public class ABClass {
        public static boolean checkInstance(Object obj) {
            return ABClass.class.isInstance(obj);
        }



    ------------------------------
    Eduardo Izquierdo Lázaro
    Automation Architect
    DECIDE
    Madrid
    609893677
    ------------------------------



  • 3.  RE: i would like to compare class object in ARL like ABClass.class.isInstance (this) but this is not compiling

    Posted Mon February 19, 2024 10:12 AM

    Thanks for your response. It's kind of mandatory that's why i am trying to get similar logic in ARL. 



    ------------------------------
    Ahmad Alam
    ------------------------------



  • 4.  RE: i would like to compare class object in ARL like ABClass.class.isInstance (this) but this is not compiling

    Posted Tue February 20, 2024 08:16 AM

    You may use

    return this instanceof ABClass;



    ------------------------------
    Jean Louis Ardoint
    ------------------------------