Field (Java SE 24 & JDK 24)
- All Implemented Interfaces:
AnnotatedElement,Member
-
Field Summary
-
Method Summary
Returns an unmodifiable set of the access flags for this field, possibly empty.
booleanCompares this
Fieldagainst the specified object.Returns the value of the field represented by this
Field, on the specified object.Returns an AnnotatedType object that represents the use of a type to specify the declared type of the field represented by this Field.
getAnnotation(Class<T> annotationClass) Returns this element's annotation for the specified type if such an annotation is present, else null.
getAnnotationsByType(Class<T> annotationClass) Returns annotations that are associated with this element.
booleanGets the value of a static or instance
booleanfield.byteGets the value of a static or instance
bytefield.charGets the value of a static or instance field of type
charor of another primitive type convertible to typecharvia a widening conversion.Returns the
Classobject representing the class or interface that declares the field represented by thisFieldobject.doubleGets the value of a static or instance field of type
doubleor of another primitive type convertible to typedoublevia a widening conversion.floatGets the value of a static or instance field of type
floator of another primitive type convertible to typefloatvia a widening conversion.Returns a
Typeobject that represents the declared type for the field represented by thisFieldobject.intGets the value of a static or instance field of type
intor of another primitive type convertible to typeintvia a widening conversion.longGets the value of a static or instance field of type
longor of another primitive type convertible to typelongvia a widening conversion.intReturns the Java language modifiers for the field represented by this
Fieldobject, as an integer.getName()Returns the name of the field represented by this
Fieldobject.shortGets the value of a static or instance field of type
shortor of another primitive type convertible to typeshortvia a widening conversion.getType()Returns a
Classobject that identifies the declared type for the field represented by thisFieldobject.inthashCode()Returns a hashcode for this
Field.booleanReturns
trueif this field represents an element of an enumerated class; returnsfalseotherwise.booleanReturns
trueif this field is a synthetic field; returnsfalseotherwise.voidSets the field represented by this
Fieldobject on the specified object argument to the specified new value.voidsetAccessible(boolean flag) Set the
accessibleflag for this reflected object to the indicated boolean value.voidSets the value of a field as a
booleanon the specified object.voidSets the value of a field as a
byteon the specified object.voidSets the value of a field as a
charon the specified object.voidSets the value of a field as a
doubleon the specified object.voidSets the value of a field as a
floaton the specified object.voidSets the value of a field as an
inton the specified object.voidSets the value of a field as a
longon the specified object.voidSets the value of a field as a
shorton the specified object.Returns a string describing this
Field, including its generic type.toString()Returns a string describing this
Field.
-
Method Details
-
setAccessible
-
getDeclaringClass
-
getName
-
getModifiers
-
accessFlags
-
isEnumConstant
-
isSynthetic
-
getType
-
getGenericType
-
equals
-
hashCode
-
toString
-
toGenericString
-
get
-
getBoolean
-
getByte
-
getChar
-
getShort
-
getInt
-
getLong
-
getFloat
-
getDouble
-
set
-
setBoolean
-
setByte
-
setChar
-
setShort
-
setInt
-
setLong
-
setFloat
-
setDouble
-
getAnnotation
-
getAnnotationsByType
-
getAnnotatedType
-