use serde::Deserialize;
use serde::Serialize;
use mago_atom::Atom;
#[derive(Clone, Debug, PartialEq, Eq, Copy, Serialize, Deserialize, Hash, PartialOrd, Ord)]
pub struct MethodIdentifier {
class_name: Atom,
method_name: Atom,
}
impl MethodIdentifier {
#[inline]
#[must_use]
pub const fn new(class_name: Atom, method_name: Atom) -> Self {
Self { class_name, method_name }
}
#[inline]
#[must_use]
pub const fn get_class_name(&self) -> Atom {
self.class_name
}
#[inline]
#[must_use]
pub const fn get_method_name(&self) -> Atom {
self.method_name
}
#[inline]
#[must_use]
pub fn as_string(&self) -> String {
format!("{}::{}", self.class_name, self.method_name)
}
#[inline]
#[must_use]
pub fn get_key(&self) -> (Atom, Atom) {
(self.class_name, self.method_name)
}
}