JniMethod.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*
  2. * Author: Patrick-Christopher Mattulat
  3. * Company: Lynar Studios
  4. * E-Mail: webmaster@lynarstudios.com
  5. * Created: 2023-04-08
  6. * Changed: 2023-05-16
  7. *
  8. * */
  9. #include <ls-std/core/evaluator/EmptyStringArgumentEvaluator.hpp>
  10. #include <ls-std/core/jni/JniMethod.hpp>
  11. using ls::std::core::EmptyStringArgumentEvaluator;
  12. using ls::std::core::experimental::JniMethod;
  13. using std::string;
  14. using std::string_view;
  15. JniMethod::JniMethod(const string &_methodIdentifier, const string &_methodSignature) : methodIdentifier(_methodIdentifier), methodSignature(_methodSignature)
  16. {
  17. EmptyStringArgumentEvaluator{_methodIdentifier, "no method identifier has been provided!"}.evaluate();
  18. EmptyStringArgumentEvaluator{_methodSignature, "no method signature has been provided!"}.evaluate();
  19. }
  20. JniMethod::~JniMethod() = default;
  21. jmethodID JniMethod::getMethodId()
  22. {
  23. return this->methodId;
  24. }
  25. string JniMethod::getMethodIdentifier() const
  26. {
  27. return this->methodIdentifier;
  28. }
  29. string JniMethod::getMethodSignature() const
  30. {
  31. return this->methodSignature;
  32. }
  33. void JniMethod::setMethodId(jmethodID _methodId)
  34. {
  35. this->methodId = _methodId;
  36. }
  37. void JniMethod::setMethodIdentifier(string_view _methodIdentifier)
  38. {
  39. this->methodIdentifier = _methodIdentifier;
  40. }
  41. void JniMethod::setMethodSignature(string_view _methodSignature)
  42. {
  43. this->methodSignature = _methodSignature;
  44. }