///
/// JHybridAudioSessionFactorySpec.cpp
/// This file was generated by nitrogen. DO NOT MODIFY THIS FILE.
/// https://github.com/mrousavy/nitro
/// Copyright © Marc Rousavy @ Margelo
///

#include "JHybridAudioSessionFactorySpec.hpp"

// Forward declaration of `HybridAudioSessionSpec` to properly resolve imports.
namespace margelo::nitro::aviation { class HybridAudioSessionSpec; }
// Forward declaration of `AudioSessionConfig` to properly resolve imports.
namespace margelo::nitro::aviation { struct AudioSessionConfig; }
// Forward declaration of `AudioSessionCategory` to properly resolve imports.
namespace margelo::nitro::aviation { enum class AudioSessionCategory; }
// Forward declaration of `AudioSessionMode` to properly resolve imports.
namespace margelo::nitro::aviation { enum class AudioSessionMode; }
// Forward declaration of `AudioCoexistence` to properly resolve imports.
namespace margelo::nitro::aviation { enum class AudioCoexistence; }

#include <memory>
#include "HybridAudioSessionSpec.hpp"
#include "JHybridAudioSessionSpec.hpp"
#include "AudioSessionConfig.hpp"
#include "JAudioSessionConfig.hpp"
#include "AudioSessionCategory.hpp"
#include <optional>
#include "JAudioSessionCategory.hpp"
#include "AudioSessionMode.hpp"
#include "JAudioSessionMode.hpp"
#include "AudioCoexistence.hpp"
#include "JAudioCoexistence.hpp"

namespace margelo::nitro::aviation {

  jni::local_ref<JHybridAudioSessionFactorySpec::jhybriddata> JHybridAudioSessionFactorySpec::initHybrid(jni::alias_ref<jhybridobject> jThis) {
    return makeCxxInstance(jThis);
  }

  void JHybridAudioSessionFactorySpec::registerNatives() {
    registerHybrid({
      makeNativeMethod("initHybrid", JHybridAudioSessionFactorySpec::initHybrid),
    });
  }

  size_t JHybridAudioSessionFactorySpec::getExternalMemorySize() noexcept {
    static const auto method = javaClassStatic()->getMethod<jlong()>("getMemorySize");
    return method(_javaPart);
  }

  bool JHybridAudioSessionFactorySpec::equals(const std::shared_ptr<HybridObject>& other) {
    if (auto otherCast = std::dynamic_pointer_cast<JHybridAudioSessionFactorySpec>(other)) {
      return _javaPart == otherCast->_javaPart;
    }
    return false;
  }

  void JHybridAudioSessionFactorySpec::dispose() noexcept {
    static const auto method = javaClassStatic()->getMethod<void()>("dispose");
    method(_javaPart);
  }

  std::string JHybridAudioSessionFactorySpec::toString() {
    static const auto method = javaClassStatic()->getMethod<jni::JString()>("toString");
    auto javaString = method(_javaPart);
    return javaString->toStdString();
  }

  // Properties
  

  // Methods
  std::shared_ptr<HybridAudioSessionSpec> JHybridAudioSessionFactorySpec::create(const AudioSessionConfig& config) {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JHybridAudioSessionSpec::javaobject>(jni::alias_ref<JAudioSessionConfig> /* config */)>("create");
    auto __result = method(_javaPart, JAudioSessionConfig::fromCpp(config));
    return __result->cthis()->shared_cast<JHybridAudioSessionSpec>();
  }
  std::shared_ptr<HybridAudioSessionSpec> JHybridAudioSessionFactorySpec::createDefault() {
    static const auto method = javaClassStatic()->getMethod<jni::local_ref<JHybridAudioSessionSpec::javaobject>()>("createDefault");
    auto __result = method(_javaPart);
    return __result->cthis()->shared_cast<JHybridAudioSessionSpec>();
  }

} // namespace margelo::nitro::aviation
