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
- Author:
- Michael Nitschinger
-
-
Constructor Summary
Constructors Constructor Description ReflectionBasedPropertyMetadata(Field fieldReference)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
encryptionProviderName()
Get the encryption crypto algorithm provider name setObject
get(Object source)
Returns the content of the field property.boolean
isField()
If this property represents a field in the Document.boolean
isId()
If this property represents the Document ID.String
name()
The name of the field inside the document.String
realName()
The name of the actual property inside the java entity.void
set(Object value, Object source)
Sets the content of the field property.Class<?>
type()
The type of the field property.
-
-
-
Constructor Detail
-
ReflectionBasedPropertyMetadata
public ReflectionBasedPropertyMetadata(Field fieldReference)
-
-
Method Detail
-
isId
public boolean isId()
Description copied from interface:PropertyMetadata
If this property represents the Document ID.- Specified by:
isId
in interfacePropertyMetadata
- 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 interfacePropertyMetadata
- 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 interfacePropertyMetadata
- 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, usePropertyMetadata.realName()
.- Specified by:
name
in interfacePropertyMetadata
- 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 interfacePropertyMetadata
- Returns:
- the real field name.
-
type
public Class<?> type()
Description copied from interface:PropertyMetadata
The type of the field property.- Specified by:
type
in interfacePropertyMetadata
- 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 interfacePropertyMetadata
- 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 interfacePropertyMetadata
- Parameters:
value
- the value to set.source
- the source object.
-
-