public class BytesFieldInfo extends Object
FieldGroup
. It provides utilities for analyzing and grouping the fields based on
their annotations, calculating the memory offset positions, and determining the size occupied
by each group of fields.
The class is particularly useful for understanding and manipulating the layout of fields within an object in memory.
Example usage might include serialization, memory analysis, or direct memory access.
FieldGroup
Modifier and Type | Method and Description |
---|---|
int |
description()
Returns the description metadata.
|
String |
dump()
Generates a string representation of the field groups within the object.
|
static List<Field> |
fields(Class<?> clazz)
Retrieves all non-static fields from the given class and its superclasses, sorted by their
memory offsets.
|
Set<String> |
groups()
Returns a set of group names extracted from the field annotations.
|
long |
lengthOf(String groupName)
Returns the total memory size in bytes occupied by the group with the given name.
|
static BytesFieldInfo |
lookup(Class<?> aClass)
Retrieves the BytesFieldInfo instance for the given class from the cache.
|
long |
startOf(String groupName)
Returns the starting memory offset for the group with the given name.
|
public int description()
public static BytesFieldInfo lookup(Class<?> aClass)
aClass
- the class to look uppublic Set<String> groups()
public long startOf(String groupName)
groupName
- the name of the groupIllegalArgumentException
- if no group with the given name is foundpublic long lengthOf(String groupName)
groupName
- the name of the groupIllegalArgumentException
- if no group with the given name is foundpublic String dump()
Copyright © 2023. All rights reserved.