Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 

README.md

FastPropertyDescriptor

FastPropertyDescriptor可以快速的对实体类的get、set方法进行反射调用,速度接近于直接使用代码调用,可以代替Java自带的反射方法

如何使用

TestEntity testEntity = new TestEntity();
// it's an example of how to initialise a AccessMethod for TestEntity
AccessMethod accessMethod = AccessMethodFactory.build(TestEntity.class)
// it's an example of how to use method set
accessMethod.set(testEntity, "property1", "It's a test value");
// it's an example of how to use method get
String testValue = (String)accessMethod.get(testEntity, "property1");
// or
String testValue = accessMethod.get(testEntity, "property1", String.class);

注意事项

由于本项目采用字节码方式生成每个实体类对应的反射类,所以首次调用某个实体类的get或set方法时会占用少量时间对这个类进行初始化(消耗的时间和类中属性的数量有关),之后的速度接近于直接调用get与set方法

About

No description or website provided.

Topics

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.