Struct jaded::ObjectData
source · pub struct ObjectData { /* private fields */ }
Expand description
Object data representing serialized Java object
Gives access to field data and class as well as any raw data added via a custom writeObject/writeExternal method.
Implementations§
source§impl ObjectData
impl ObjectData
sourcepub fn class_name(&self) -> &str
pub fn class_name(&self) -> &str
Get the fully qualified class name of the type of this object
sourcepub fn get_field(&self, name: &str) -> Option<&Value>
pub fn get_field(&self, name: &str) -> Option<&Value>
Get the value associated with a field if it exists
None
indicates that the field is not present. A null
value will
be returned as Some(Value::Null)
.
sourcepub fn get_field_as<T: FromJava>(&self, name: &str) -> ConversionResult<T>
pub fn get_field_as<T: FromJava>(&self, name: &str) -> ConversionResult<T>
Get field and convert to Rust entity
sourcepub fn get_annotation(&self, ind: usize) -> Option<AnnotationIter<'_>>
pub fn get_annotation(&self, ind: usize) -> Option<AnnotationIter<'_>>
Get the annotations written by a class in this object’s class hierachy
eg if Child
extends Parent
, then get_annotation(0)
on an instance of Child
will return
the annotations written by Parent
and get_annotation(1)
will return annotations written
by Child
.
sourcepub fn annotation_count(&self) -> usize
pub fn annotation_count(&self) -> usize
Get the total number of object annotations added to this object by any of the classes in its class hierarchy.
sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Get the number of fields written for this object
Trait Implementations§
source§impl Debug for ObjectData
impl Debug for ObjectData
source§impl PartialEq<ObjectData> for ObjectData
impl PartialEq<ObjectData> for ObjectData
source§fn eq(&self, other: &ObjectData) -> bool
fn eq(&self, other: &ObjectData) -> bool
self
and other
values to be equal, and is used
by ==
.