memberGet method

  1. @override
dynamic memberGet(
  1. String varName, {
  2. String? from,
})
override

Fetch a member by the varName, in the form of

object.varName

varName must be of String type.

Implementation

@override
dynamic memberGet(String varName, {String? from}) {
  switch (varName) {
    case 'Hash.uid4':
      return (HTEntity entity,
          {List<dynamic> positionalArgs = const [],
          Map<String, dynamic> namedArgs = const {},
          List<HTType> typeArgs = const []}) {
        return uid4(positionalArgs.first);
      };
    case 'Hash.crcString':
      return (HTEntity entity,
          {List<dynamic> positionalArgs = const [],
          Map<String, dynamic> namedArgs = const {},
          List<HTType> typeArgs = const []}) {
        String data = positionalArgs[0];
        int crc = positionalArgs[1] ?? 0;
        return crcString(data, crc);
      };
    case 'Hash.crcInt':
      return (HTEntity entity,
          {List<dynamic> positionalArgs = const [],
          Map<String, dynamic> namedArgs = const {},
          List<HTType> typeArgs = const []}) {
        String data = positionalArgs[0];
        int crc = positionalArgs[1] ?? 0;
        return crcInt(data, crc);
      };
    default:
      throw HTError.undefined(varName);
  }
}