Class 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 setter Method.
    • 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>
      A
      getAnnotation​(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 example TypeLiteral<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()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • method

        private final java.lang.reflect.Method method
    • Constructor Detail

      • BeanPropertySetter

        BeanPropertySetter​(java.lang.reflect.Method method)
    • 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 interface BeanProperty<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 example TypeLiteral<List<String>>.
        Specified by:
        getType in interface BeanProperty<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 interface BeanProperty<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 interface BeanProperty<T>
        Parameters:
        bean - The bean to update
        value - The value to set
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object rhs)
        Overrides:
        equals in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • run

        public java.lang.Void run()
        Specified by:
        run in interface java.security.PrivilegedAction<T>