Class ReflectionBasedPropertyMetadata

java.lang.Object
com.couchbase.client.java.repository.mapping.ReflectionBasedPropertyMetadata
All Implemented Interfaces:
PropertyMetadata

public class ReflectionBasedPropertyMetadata
extends Object
implements PropertyMetadata
The property metadata implementation based on java reflection.
Since:
2.2.0
  • Constructor Details

    • ReflectionBasedPropertyMetadata

      public ReflectionBasedPropertyMetadata​(Field fieldReference)
  • Method Details

    • isId

      public boolean isId()
      Description copied from interface: PropertyMetadata
      If this property represents the Document ID.
      Specified by:
      isId in interface PropertyMetadata
      Returns:
      true if it does, false otherwise.
    • isField

      public boolean isField()
      Description copied from interface: PropertyMetadata
      If this property represents a field in the Document.
      Specified by:
      isField in interface PropertyMetadata
      Returns:
      true if it does, false otherwise.
    • encryptionProviderName

      public String encryptionProviderName()
      Description copied from interface: PropertyMetadata
      Get the encryption crypto algorithm provider name set
      Specified by:
      encryptionProviderName in interface PropertyMetadata
      Returns:
      the crypto provider name
    • name

      public String name()
      Description copied from interface: PropertyMetadata
      The name of the field inside the document. If an alias is used, it is reflected in here. If the raw field name in the entity is needed, use PropertyMetadata.realName().
      Specified by:
      name in interface PropertyMetadata
      Returns:
      the name of the field.
    • realName

      public String realName()
      Description copied from interface: PropertyMetadata
      The name of the actual property inside the java entity.
      Specified by:
      realName in interface PropertyMetadata
      Returns:
      the real field name.
    • type

      public Class<?> type()
      Description copied from interface: PropertyMetadata
      The type of the field property.
      Specified by:
      type in interface PropertyMetadata
      Returns:
      the type.
    • get

      public Object get​(Object source)
      Description copied from interface: PropertyMetadata
      Returns the content of the field property.
      Specified by:
      get in interface PropertyMetadata
      Parameters:
      source - the source object.
      Returns:
      the content of the field.
    • set

      public void set​(Object value, Object source)
      Description copied from interface: PropertyMetadata
      Sets the content of the field property.
      Specified by:
      set in interface PropertyMetadata
      Parameters:
      value - the value to set.
      source - the source object.