Package cz.o2.proxima.core.repository
Interface AttributeDescriptor<T>
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
AttributeDescriptorBase
,AttributeDescriptorImpl
,AttributeProxyDescriptor
,EntityAwareAttributeDescriptor
,EntityAwareAttributeDescriptor.Regular
,EntityAwareAttributeDescriptor.Wildcard
@Stable public interface AttributeDescriptor<T> extends java.io.Serializable
An interface describing each attribute.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AttributeDescriptor.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default AttributeProxyDescriptor<T>
asProxy()
java.lang.String
getEntity()
Retrieve name of the associated entity.java.lang.String
getName()
Retrieve name of the attribute.default SchemaDescriptors.SchemaTypeDescriptor<T>
getSchemaTypeDescriptor()
ReturnSchemaDescriptors.SchemaTypeDescriptor
for given attribute value.java.net.URI
getSchemeUri()
Retrieve URI of the scheme of this attribute.default java.util.List<java.lang.String>
getTransactionalManagerFamilies()
Retrieve transactional manager families for this attribute.TransactionMode
getTransactionMode()
Retrieve type of transactional support of this attribute.ValueSerializer<T>
getValueSerializer()
Retrieve serializer for value type.default boolean
isProxy()
Check if this is a proxy attribute.boolean
isPublic()
Marker if this is a public attribute.boolean
isWildcard()
Check if this is a wildcard attribute.static AttributeDescriptor.Builder
newBuilder(Repository repo)
static <T> AttributeDescriptorBase<T>
newProxy(java.lang.String name, AttributeDescriptor<T> targetRead, ProxyTransform transformRead, AttributeDescriptor<T> targetWrite, ProxyTransform transformWrite, boolean replica, java.net.URI schemeURI, ValueSerializer<T> valueSerializer)
static <T> AttributeDescriptorBase<T>
newProxy(java.lang.String name, AttributeDescriptor<T> targetRead, ProxyTransform transformRead, AttributeDescriptor<T> targetWrite, ProxyTransform transformWrite, java.net.URI schemeURI, ValueSerializer<T> valueSerializer)
default java.lang.String
toAttributePrefix()
Retrieve name of the attribute if not wildcard, otherwise retrieve the prefix without the last asterisk.java.lang.String
toAttributePrefix(boolean includeLastDot)
Retrieve name of the attribute if not wildcard, otherwise retrieve the prefix without the last asterisk.AttributeDescriptor.Builder
toBuilder(Repository repo)
Convert this attribute back to builder.default java.util.Optional<T>
valueOf(StreamElement el)
-
-
-
Method Detail
-
newBuilder
static AttributeDescriptor.Builder newBuilder(Repository repo)
-
newProxy
static <T> AttributeDescriptorBase<T> newProxy(java.lang.String name, AttributeDescriptor<T> targetRead, ProxyTransform transformRead, AttributeDescriptor<T> targetWrite, ProxyTransform transformWrite, java.net.URI schemeURI, ValueSerializer<T> valueSerializer)
-
newProxy
static <T> AttributeDescriptorBase<T> newProxy(java.lang.String name, AttributeDescriptor<T> targetRead, ProxyTransform transformRead, AttributeDescriptor<T> targetWrite, ProxyTransform transformWrite, boolean replica, java.net.URI schemeURI, ValueSerializer<T> valueSerializer)
-
getName
java.lang.String getName()
Retrieve name of the attribute.- Returns:
- name of the attribute
-
isWildcard
boolean isWildcard()
Check if this is a wildcard attribute.- Returns:
true
when this is wildcard attribute
-
getSchemeUri
java.net.URI getSchemeUri()
Retrieve URI of the scheme of this attribute.- Returns:
- scheme URI of this attribute
-
getEntity
java.lang.String getEntity()
Retrieve name of the associated entity.- Returns:
- name of the associated entity
-
toAttributePrefix
default java.lang.String toAttributePrefix()
Retrieve name of the attribute if not wildcard, otherwise retrieve the prefix without the last asterisk.- Returns:
- attribute prefix of this attribute
-
toAttributePrefix
java.lang.String toAttributePrefix(boolean includeLastDot)
Retrieve name of the attribute if not wildcard, otherwise retrieve the prefix without the last asterisk.- Parameters:
includeLastDot
-true
to include dot suffix of the prefix- Returns:
- attribute prefix with or without dot
-
getValueSerializer
ValueSerializer<T> getValueSerializer()
Retrieve serializer for value type.- Returns:
ValueSerializer
of this attribute's value
-
isPublic
boolean isPublic()
Marker if this is a public attribute.- Returns:
true
it this is public attribute
-
toBuilder
AttributeDescriptor.Builder toBuilder(Repository repo)
Convert this attribute back to builder.- Parameters:
repo
- the repository- Returns:
- builder representing this attribute
-
isProxy
default boolean isProxy()
Check if this is a proxy attribute.- Returns:
true
is this is proxyfalse
otherwise
-
getTransactionMode
TransactionMode getTransactionMode()
Retrieve type of transactional support of this attribute.- Returns:
TransactionMode
of the attribute.
-
getTransactionalManagerFamilies
default java.util.List<java.lang.String> getTransactionalManagerFamilies()
Retrieve transactional manager families for this attribute.
-
asProxy
default AttributeProxyDescriptor<T> asProxy() throws java.lang.ClassCastException
Convert this object toAttributeProxyDescriptor
iffisProxy()
returnstrue
. ThrowClassCastException
otherwise.- Returns:
- this converted as
AttributeProxyDescriptor
- Throws:
java.lang.ClassCastException
- whenisProxy()
returns false
-
valueOf
default java.util.Optional<T> valueOf(StreamElement el)
-
getSchemaTypeDescriptor
default SchemaDescriptors.SchemaTypeDescriptor<T> getSchemaTypeDescriptor()
ReturnSchemaDescriptors.SchemaTypeDescriptor
for given attribute value.- Returns:
- value descriptor
-
-