mixinafBeanUtils::BeanEquality

afBeanUtils::BeanEquality

@Js

Provides equals(), hash() and toStr() methods that calculate bean equality based on fields. Sample usage:

class User {
    Int? id
    Str? name
    Str? wotever 

    override Int hash() {
      BeanEquality.beanHash(this, [#id, #name])
    }
  
    override Bool equals(Obj? obj) {
      BeanEquality.beanEquals(this, obj, [#id, #name])
    }
  
    override Str toStr() {
      BeanEquality.beanToStr(this, [#id, #name])
    }
}
beanEquals

Source

const static Bool beanEquals(Obj objThis, Obj? obj, Field[] fields)

Calculates equality based on the given fields.

beanHash

Source

const static Int beanHash(Obj objThis, Field[] fields)

Calculates a hash value from the given fields.

beanToStr

Source

const static Str beanToStr(Obj objThis, Field[] fields)

Calculates a Str value from the given fields.