diff --git a/btypes_primitives/src/main/rust/btypes/src/bstring.rs b/btypes_primitives/src/main/rust/btypes/src/bstring.rs index e49302b41c87b2d8b511fd4bad1b10456db9e2e8..62a0ee4b3b32a8247dcf3a9b84c8d104091ecc1e 100644 --- a/btypes_primitives/src/main/rust/btypes/src/bstring.rs +++ b/btypes_primitives/src/main/rust/btypes/src/bstring.rs @@ -1,5 +1,6 @@ use std::fmt::{Display, Formatter}; use crate::bobject::BObject; +use crate::bboolean::BBoolean; #[derive(Default, Debug, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)] pub struct BString { @@ -16,4 +17,26 @@ impl Display for BString { } } -impl BObject for BString {} \ No newline at end of file +impl BObject for BString {} + +impl BString { + pub fn new(init: &str) -> BString { + return BString { val: String::from(init) } + } + + pub fn isString(&self) -> BBoolean { + return true; + } + + pub fn isNotString(&self) -> BBoolean { + return false; + } + + pub fn equal(&self, other: &BString) -> BBoolean { + return self.eq(other); + } + + pub fn unequal(&self, other: &BString) -> BBoolean { + return !self.eq(other); + } +}