Package io.micronaut.data.model.runtime
Class RuntimePersistentProperty<T>
- java.lang.Object
-
- io.micronaut.data.model.runtime.RuntimePersistentProperty<T>
-
- Type Parameters:
T
- The owner type
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,io.micronaut.core.naming.Named
,PersistentElement
,PersistentProperty
- Direct Known Subclasses:
RuntimeAssociation
public class RuntimePersistentProperty<T> extends java.lang.Object implements PersistentProperty
A runtime representation ofPersistentProperty
.- Since:
- 1.0.0
- Author:
- graemerocher
-
-
Field Summary
Fields Modifier and Type Field Description static RuntimePersistentProperty<java.lang.Object>[]
EMPTY_PROPERTY_ARRAY
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.micronaut.core.annotation.AnnotationMetadata
getAnnotationMetadata()
io.micronaut.core.type.Argument<?>
getArgument()
AttributeConverter<java.lang.Object,java.lang.Object>
getConverter()
DataType
getDataType()
java.lang.String
getName()
The name of the property.RuntimePersistentEntity<T>
getOwner()
Obtains the owner of this persistent property.java.lang.String
getPersistedName()
The persisted name is the fully qualified name including potential schema definitions.io.micronaut.core.beans.BeanProperty<T,?>
getProperty()
java.lang.Class<?>
getType()
java.lang.String
getTypeName()
The type of the property.boolean
isAssignable(java.lang.Class<?> type)
Is the property assignable to the given type.boolean
isAssignable(java.lang.String type)
Is the property assignable to the given type name.boolean
isConstructorArgument()
boolean
isEnum()
boolean
isOptional()
Whether the property can be set to null.boolean
isReadOnly()
Whether the property is read-only, for example for generated values.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByType
-
Methods inherited from interface io.micronaut.core.annotation.AnnotationSource
getAnnotation, getAnnotation, getDeclaredAnnotation, getDeclaredAnnotation, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeDeclared
-
Methods inherited from interface io.micronaut.data.model.PersistentProperty
getCapitilizedName, isAutoPopulated, isGenerated, isRequired
-
-
-
-
Field Detail
-
EMPTY_PROPERTY_ARRAY
public static final RuntimePersistentProperty<java.lang.Object>[] EMPTY_PROPERTY_ARRAY
-
-
Method Detail
-
getArgument
public io.micronaut.core.type.Argument<?> getArgument()
- Returns:
- The argument for this property.
-
isConstructorArgument
public boolean isConstructorArgument()
- Specified by:
isConstructorArgument
in interfacePersistentProperty
- Returns:
- Is the property also a constructor argument.
-
isOptional
public final boolean isOptional()
Description copied from interface:PersistentProperty
Whether the property can be set to null.- Specified by:
isOptional
in interfacePersistentProperty
- Returns:
- True if it can
-
isEnum
public boolean isEnum()
- Specified by:
isEnum
in interfacePersistentProperty
- Returns:
- Returns whether the property is an enum.
-
getDataType
public DataType getDataType()
- Specified by:
getDataType
in interfacePersistentProperty
- Returns:
- The data type
-
isReadOnly
public boolean isReadOnly()
Description copied from interface:PersistentProperty
Whether the property is read-only, for example for generated values.- Specified by:
isReadOnly
in interfacePersistentProperty
- Returns:
- True if it is read-only
-
getType
@NonNull public java.lang.Class<?> getType()
- Returns:
- The property type, unwrapped if primitive
-
getName
@NonNull public java.lang.String getName()
Description copied from interface:PersistentProperty
The name of the property.- Specified by:
getName
in interfaceio.micronaut.core.naming.Named
- Specified by:
getName
in interfacePersistentProperty
- Returns:
- The property name
-
getTypeName
@NonNull public java.lang.String getTypeName()
Description copied from interface:PersistentProperty
The type of the property.- Specified by:
getTypeName
in interfacePersistentProperty
- Returns:
- The property type
-
getOwner
@NonNull public RuntimePersistentEntity<T> getOwner()
Description copied from interface:PersistentProperty
Obtains the owner of this persistent property.- Specified by:
getOwner
in interfacePersistentProperty
- Returns:
- The owner
-
isAssignable
public boolean isAssignable(@NonNull java.lang.String type)
Description copied from interface:PersistentProperty
Is the property assignable to the given type name.- Specified by:
isAssignable
in interfacePersistentProperty
- Parameters:
type
- The type name- Returns:
- True if it is
-
isAssignable
public boolean isAssignable(@NonNull java.lang.Class<?> type)
Description copied from interface:PersistentProperty
Is the property assignable to the given type.- Specified by:
isAssignable
in interfacePersistentProperty
- Parameters:
type
- The type- Returns:
- True it is
-
getAnnotationMetadata
public io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()
- Specified by:
getAnnotationMetadata
in interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
getProperty
public io.micronaut.core.beans.BeanProperty<T,?> getProperty()
- Returns:
- The backing bean property
-
getConverter
public AttributeConverter<java.lang.Object,java.lang.Object> getConverter()
- Specified by:
getConverter
in interfacePersistentProperty
- Returns:
- Returns possible property convertor.
-
getPersistedName
@NonNull public java.lang.String getPersistedName()
Description copied from interface:PersistentElement
The persisted name is the fully qualified name including potential schema definitions.- Specified by:
getPersistedName
in interfacePersistentElement
- Returns:
- The persisted name.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-