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 classAttributeDescriptor.Builder
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default AttributeProxyDescriptor<T>asProxy()java.lang.StringgetEntity()Retrieve name of the associated entity.java.lang.StringgetName()Retrieve name of the attribute.default SchemaDescriptors.SchemaTypeDescriptor<T>getSchemaTypeDescriptor()ReturnSchemaDescriptors.SchemaTypeDescriptorfor given attribute value.java.net.URIgetSchemeUri()Retrieve URI of the scheme of this attribute.default java.util.List<java.lang.String>getTransactionalManagerFamilies()Retrieve transactional manager families for this attribute.TransactionModegetTransactionMode()Retrieve type of transactional support of this attribute.ValueSerializer<T>getValueSerializer()Retrieve serializer for value type.default booleanisProxy()Check if this is a proxy attribute.booleanisPublic()Marker if this is a public attribute.booleanisWildcard()Check if this is a wildcard attribute.static AttributeDescriptor.BuildernewBuilder(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.StringtoAttributePrefix()Retrieve name of the attribute if not wildcard, otherwise retrieve the prefix without the last asterisk.java.lang.StringtoAttributePrefix(boolean includeLastDot)Retrieve name of the attribute if not wildcard, otherwise retrieve the prefix without the last asterisk.AttributeDescriptor.BuildertoBuilder(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:
truewhen 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-trueto include dot suffix of the prefix- Returns:
- attribute prefix with or without dot
-
getValueSerializer
ValueSerializer<T> getValueSerializer()
Retrieve serializer for value type.- Returns:
ValueSerializerof this attribute's value
-
isPublic
boolean isPublic()
Marker if this is a public attribute.- Returns:
trueit 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:
trueis this is proxyfalseotherwise
-
getTransactionMode
TransactionMode getTransactionMode()
Retrieve type of transactional support of this attribute.- Returns:
TransactionModeof 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 toAttributeProxyDescriptoriffisProxy()returnstrue. ThrowClassCastExceptionotherwise.- 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.SchemaTypeDescriptorfor given attribute value.- Returns:
- value descriptor
-
-