Package org.eclipse.sisu.bean
Class BeanPropertySetter<T>
- java.lang.Object
-
- org.eclipse.sisu.bean.BeanPropertySetter<T>
-
- All Implemented Interfaces:
java.security.PrivilegedAction<java.lang.Void>
,BeanProperty<T>
final class BeanPropertySetter<T> extends java.lang.Object implements BeanProperty<T>, java.security.PrivilegedAction<java.lang.Void>
BeanProperty
backed by a single-parameter setterMethod
.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.reflect.Method
method
-
Constructor Summary
Constructors Constructor Description BeanPropertySetter(java.lang.reflect.Method method)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object rhs)
<A extends java.lang.annotation.Annotation>
AgetAnnotation(java.lang.Class<A> annotationType)
Returns the property annotation with the specified type.java.lang.String
getName()
Returns the normalized property name excluding the namespace; for example"address"
.com.google.inject.TypeLiteral<T>
getType()
Returns the reified generic type of the property; for exampleTypeLiteral<List<String>>
.int
hashCode()
java.lang.Void
run()
<B> void
set(B bean, T value)
Sets the property in the given bean to the given value.java.lang.String
toString()
-
-
-
Method Detail
-
getAnnotation
public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationType)
Description copied from interface:BeanProperty
Returns the property annotation with the specified type.- Specified by:
getAnnotation
in interfaceBeanProperty<T>
- Parameters:
annotationType
- The annotation type- Returns:
- Property annotation if it exists; otherwise
null
-
getType
public com.google.inject.TypeLiteral<T> getType()
Description copied from interface:BeanProperty
Returns the reified generic type of the property; for exampleTypeLiteral<List<String>>
.- Specified by:
getType
in interfaceBeanProperty<T>
- Returns:
- Reified generic type
-
getName
public java.lang.String getName()
Description copied from interface:BeanProperty
Returns the normalized property name excluding the namespace; for example"address"
.- Specified by:
getName
in interfaceBeanProperty<T>
- Returns:
- Normalized property name
-
set
public <B> void set(B bean, T value)
Description copied from interface:BeanProperty
Sets the property in the given bean to the given value.- Specified by:
set
in interfaceBeanProperty<T>
- Parameters:
bean
- The bean to updatevalue
- The value to set
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object rhs)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
run
public java.lang.Void run()
- Specified by:
run
in interfacejava.security.PrivilegedAction<T>
-
-