类 FieldUtils
java.lang.Object
com.baidu.bjf.remoting.protobuf.utils.FieldUtils
Field utility class.
- 从以下版本开始:
- 1.0.0
- 作者:
- xiemalin
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static Fieldstatic FieldfindMatchedFields(Class targetClass, Class ann) static ObjectGet the field represented by the suppliedfield objecton the specifiedtarget object.static voidSet the field represented by the suppliedfield objecton the specifiedtarget objectto the specifiedvalue.static StringtoObjectType(String primitiveType)
-
构造器详细资料
-
FieldUtils
public FieldUtils()
-
-
方法详细资料
-
toObjectType
-
getField
Get the field represented by the suppliedfield objecton the specifiedtarget object. In accordance withField.get(Object)semantics, the returned value is automatically wrapped if the underlying field has a primitive type.Thrown exceptions are handled via a call to
- 参数:
t- the target object from which to get the fieldname- the field to get- 返回:
- the field's current value
-
setField
Set the field represented by the suppliedfield objecton the specifiedtarget objectto the specifiedvalue. In accordance withField.set(Object, Object)semantics, the new value is automatically unwrapped if the underlying field has a primitive type.Thrown exceptions are handled via a call to
- 参数:
t- the target object on which to set the fieldname- the field to setvalue- the value to set; may benull
-
findField
Attempt to find afieldon the suppliedClasswith the suppliedname. Searches all superclasses up toObject.- 参数:
clazz- the class to introspectname- the name of the field- 返回:
- the corresponding Field object, or
nullif not found
-
findField
Attempt to find afieldon the suppliedClasswith the suppliednameand/ortype. Searches all superclasses up toObject.- 参数:
clazz- the class to introspectname- the name of the field (may benullif type is specified)type- the type of the field (may benullif name is specified)- 返回:
- the corresponding Field object, or
nullif not found
-
findMatchedFields
- 参数:
targetClass- taget class- 返回:
- found
Fieldlist
-