Class Property

  • Direct Known Subclasses:
    JaversProperty

    public class Property
    extends java.lang.Object
    Domain object's data property, getter or field
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String EMBEDDED_ID_ANN  
      static java.lang.String ID_ANN  
    • Constructor Summary

      Constructors 
      Constructor Description
      Property​(JaversMember member)  
      Property​(JaversMember member, boolean hasTransientAnn, boolean hasShallowReferenceAnn, java.lang.String name, boolean hasIncludedAnn)  
      Property​(JaversMember member, boolean hasTransientAnn, boolean hasShallowReferenceAnn, java.util.Optional<java.lang.String> name, boolean hasIncludedAnn)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      java.lang.Object get​(java.lang.Object target)
      Returns property value, even if private.
      java.lang.Class<?> getDeclaringClass()  
      java.lang.reflect.Type getGenericType()  
      JaversMember getMember()  
      java.lang.String getName()
      Property name used by JaVers, originalName by default, can be changed with @PropertyName.
      java.lang.String getOriginalName()
      Property name as in Java class
      java.lang.Class<?> getRawType()
      use getGenericType() when possible, see JaversMember.resolvedReturnType
      boolean hasCustomName()  
      int hashCode()  
      boolean hasShallowReferenceAnn()  
      boolean hasTransientAnn()  
      boolean isHasIncludedAnn()  
      boolean isNull​(java.lang.Object target)  
      boolean looksLikeId()
      true if property looks like identifier of an Entity, for example has @Id annotation
      void set​(java.lang.Object target, java.lang.Object value)
      Sets property value, even if private.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Property

        public Property​(JaversMember member,
                        boolean hasTransientAnn,
                        boolean hasShallowReferenceAnn,
                        java.util.Optional<java.lang.String> name,
                        boolean hasIncludedAnn)
      • Property

        public Property​(JaversMember member,
                        boolean hasTransientAnn,
                        boolean hasShallowReferenceAnn,
                        java.lang.String name,
                        boolean hasIncludedAnn)
    • Method Detail

      • getGenericType

        public java.lang.reflect.Type getGenericType()
      • getDeclaringClass

        public java.lang.Class<?> getDeclaringClass()
      • getRawType

        public java.lang.Class<?> getRawType()
        use getGenericType() when possible, see JaversMember.resolvedReturnType
      • looksLikeId

        public boolean looksLikeId()
        true if property looks like identifier of an Entity, for example has @Id annotation
      • get

        public java.lang.Object get​(java.lang.Object target)
        Returns property value, even if private. If there is no this property in target -- returns MissingProperty.INSTANCE
        Parameters:
        target - invocation target
      • set

        public void set​(java.lang.Object target,
                        java.lang.Object value)
        Sets property value, even if private.
        Swallows JaversException.MISSING_PROPERTY
        Parameters:
        target - invocation target
        value - value to be set
      • isNull

        public boolean isNull​(java.lang.Object target)
      • getName

        public java.lang.String getName()
        Property name used by JaVers, originalName by default, can be changed with @PropertyName.
      • getOriginalName

        public java.lang.String getOriginalName()
        Property name as in Java class
      • hasCustomName

        public boolean hasCustomName()
      • hasTransientAnn

        public boolean hasTransientAnn()
      • isHasIncludedAnn

        public boolean isHasIncludedAnn()
      • hasShallowReferenceAnn

        public boolean hasShallowReferenceAnn()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

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

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