Package cz.o2.proxima.core.repository
Interface EntityDescriptor
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
EntityDescriptorImpl
@Stable public interface EntityDescriptor extends java.io.Serializable
An interface representing descriptor of entity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
EntityDescriptor.Builder
Builder of the descriptor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default <T> java.util.Optional<AttributeDescriptor<T>>
findAttribute(java.lang.String name)
Find attribute by name.<T> java.util.Optional<AttributeDescriptor<T>>
findAttribute(java.lang.String name, boolean includeProtected)
Find attribute by name.default java.util.List<AttributeDescriptor<?>>
getAllAttributes()
List all attribute descriptors of given entity.java.util.List<AttributeDescriptor<?>>
getAllAttributes(boolean includeProtected)
Find all attributes of this entity.default <T> AttributeDescriptor<T>
getAttribute(java.lang.String name)
Get attribute by name.default <T> AttributeDescriptor<T>
getAttribute(java.lang.String name, boolean includeProtected)
Get attribute by name.java.lang.String
getName()
Name of the entity.default boolean
isSystemEntity()
default boolean
isTransactional()
static EntityDescriptor.Builder
newBuilder()
-
-
-
Method Detail
-
newBuilder
static EntityDescriptor.Builder newBuilder()
-
getName
java.lang.String getName()
Name of the entity.- Returns:
- name of the entity
-
findAttribute
<T> java.util.Optional<AttributeDescriptor<T>> findAttribute(java.lang.String name, boolean includeProtected)
Find attribute by name.- Type Parameters:
T
- value type- Parameters:
name
- name of the attribute to search forincludeProtected
-true
to allow search for protected fields (prefixed by _).- Returns:
- optional found attribute descriptor
-
findAttribute
default <T> java.util.Optional<AttributeDescriptor<T>> findAttribute(java.lang.String name)
Find attribute by name. Do not search protected fields (prefixed by _).- Type Parameters:
T
- value type- Parameters:
name
- name of the attribute to search for- Returns:
- optional found attribute descriptor
-
getAttribute
default <T> AttributeDescriptor<T> getAttribute(java.lang.String name, boolean includeProtected)
Get attribute by name.- Type Parameters:
T
- value type- Parameters:
name
- name of the attribute to search forincludeProtected
-true
to allow search for protected fields (prefixed by _).- Returns:
- attribute descriptor
-
isTransactional
default boolean isTransactional()
- Returns:
true
if the entity contains any attribute that has transactions enabled.
-
isSystemEntity
default boolean isSystemEntity()
- Returns:
true
if this is system entity. System entities are created by the platform itself and should be (directly) accessed by users.
-
getAttribute
default <T> AttributeDescriptor<T> getAttribute(java.lang.String name)
Get attribute by name.- Type Parameters:
T
- value type- Parameters:
name
- name of the attribute to search for- Returns:
- attribute descriptor
-
getAllAttributes
java.util.List<AttributeDescriptor<?>> getAllAttributes(boolean includeProtected)
Find all attributes of this entity.- Parameters:
includeProtected
- whentrue
then protected attributes are also included (prefixed by _).- Returns:
- all attributes of entity (including protected or not)
-
getAllAttributes
default java.util.List<AttributeDescriptor<?>> getAllAttributes()
List all attribute descriptors of given entity.- Returns:
- get all unprotected attributes of entity
-
-