isA<T extends JObject?> method

bool isA<T extends JObject?>(
  1. JObjType<T> type
)
inherited

Whether this object is of the given type.

For example:

if (object.isA(JLong.type)) {
  final i = object.as(JLong.type).longValue;
  ...
}

Implementation

bool isA<T extends JObject?>(JObjType<T> type) {
  final targetJClass = type.jClass;
  final canBeCasted = isInstanceOf(targetJClass);
  targetJClass.release();
  return canBeCasted;
}