Package io.micronaut.data.connection
Record Class DefaultConnectionDefinition
java.lang.Object
java.lang.Record
io.micronaut.data.connection.DefaultConnectionDefinition
- Record Components:
name
- The connection namepropagationBehavior
- The propagation behaviourtimeout
- The timeoutreadOnlyValue
- The read onlyannotationMetadata
- The annotation metadata
- All Implemented Interfaces:
io.micronaut.core.annotation.AnnotationMetadataProvider
,io.micronaut.core.annotation.AnnotationSource
,ConnectionDefinition
@Internal
public record DefaultConnectionDefinition(@Nullable String name, ConnectionDefinition.Propagation propagationBehavior, @Nullable Duration timeout, Boolean readOnlyValue, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata)
extends Record
implements ConnectionDefinition
Default implementation of the
ConnectionDefinition
interface.- Since:
- 4.0.0
- Author:
- Denis Stepanov
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.data.connection.ConnectionDefinition
ConnectionDefinition.Propagation
-
Field Summary
Fields inherited from interface io.micronaut.core.annotation.AnnotationSource
EMPTY
Fields inherited from interface io.micronaut.data.connection.ConnectionDefinition
DEFAULT, PROPAGATION_DEFAULT, READ_ONLY, REQUIRES_NEW
-
Constructor Summary
ConstructorDescriptionDefaultConnectionDefinition
(@Nullable String name, ConnectionDefinition.Propagation propagationBehavior, @Nullable Duration timeout, Boolean readOnlyValue, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) Creates an instance of aDefaultConnectionDefinition
record class.DefaultConnectionDefinition
(ConnectionDefinition.Propagation propagationBehaviour) DefaultConnectionDefinition
(String name, boolean readOnly) DefaultConnectionDefinition
(String name, ConnectionDefinition.Propagation propagationBehavior, Duration timeout, Boolean readOnlyValue) -
Method Summary
Modifier and TypeMethodDescription@NonNull io.micronaut.core.annotation.AnnotationMetadata
Returns the value of theannotationMetadata
record component.final boolean
Indicates whether some other object is "equal to" this one.@NonNull io.micronaut.core.annotation.AnnotationMetadata
getName()
Return the name of this connection.@NonNull ConnectionDefinition.Propagation
Return the propagation behavior.Return the connection timeout.final int
hashCode()
Returns a hash code value for this object.Return whether this is a read-only connection.@Nullable String
name()
Returns the value of thename
record component.Returns the value of thepropagationBehavior
record component.Returns the value of thereadOnlyValue
record component.@Nullable Duration
timeout()
Returns the value of thetimeout
record component.final String
toString()
Returns a string representation of this record class.withAnnotationMetadata
(io.micronaut.core.annotation.AnnotationMetadata newAnnotationMetadata) Connection definition with new annotation metadata.Connection definition with specific name.withPropagation
(ConnectionDefinition.Propagation propagation) Connection definition with specific propagation.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getTargetAnnotationMetadata, 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
-
Constructor Details
-
DefaultConnectionDefinition
-
DefaultConnectionDefinition
-
DefaultConnectionDefinition
public DefaultConnectionDefinition(String name, ConnectionDefinition.Propagation propagationBehavior, Duration timeout, Boolean readOnlyValue) -
DefaultConnectionDefinition
public DefaultConnectionDefinition(@Nullable @Nullable String name, ConnectionDefinition.Propagation propagationBehavior, @Nullable @Nullable Duration timeout, Boolean readOnlyValue, @NonNull @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) Creates an instance of aDefaultConnectionDefinition
record class.- Parameters:
name
- the value for thename
record componentpropagationBehavior
- the value for thepropagationBehavior
record componenttimeout
- the value for thetimeout
record componentreadOnlyValue
- the value for thereadOnlyValue
record componentannotationMetadata
- the value for theannotationMetadata
record component
-
-
Method Details
-
isReadOnly
Description copied from interface:ConnectionDefinition
Return whether this is a read-only connection.- Specified by:
isReadOnly
in interfaceConnectionDefinition
- Returns:
- The optional read only
-
getPropagationBehavior
Description copied from interface:ConnectionDefinition
Return the propagation behavior.- Specified by:
getPropagationBehavior
in interfaceConnectionDefinition
- Returns:
- The propagation behaviour
-
getTimeout
Description copied from interface:ConnectionDefinition
Return the connection timeout.- Specified by:
getTimeout
in interfaceConnectionDefinition
- Returns:
- The optional timeout
-
getName
Description copied from interface:ConnectionDefinition
Return the name of this connection.- Specified by:
getName
in interfaceConnectionDefinition
- Returns:
- The optional name
-
withPropagation
Description copied from interface:ConnectionDefinition
Connection definition with specific propagation.- Specified by:
withPropagation
in interfaceConnectionDefinition
- Parameters:
propagation
- The new propagation- Returns:
- A new connection definition with specified propagation
-
withName
Description copied from interface:ConnectionDefinition
Connection definition with specific name.- Specified by:
withName
in interfaceConnectionDefinition
- Parameters:
name
- The new name- Returns:
- A new connection definition with specified name
-
withAnnotationMetadata
public ConnectionDefinition withAnnotationMetadata(io.micronaut.core.annotation.AnnotationMetadata newAnnotationMetadata) Description copied from interface:ConnectionDefinition
Connection definition with new annotation metadata.- Specified by:
withAnnotationMetadata
in interfaceConnectionDefinition
- Parameters:
newAnnotationMetadata
- The new annotation metadata- Returns:
- A new connection definition with specified annotation metadata
-
getAnnotationMetadata
@NonNull public @NonNull io.micronaut.core.annotation.AnnotationMetadata getAnnotationMetadata()- Specified by:
getAnnotationMetadata
in interfaceio.micronaut.core.annotation.AnnotationMetadataProvider
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object)
. -
name
Returns the value of thename
record component.- Returns:
- the value of the
name
record component
-
propagationBehavior
Returns the value of thepropagationBehavior
record component.- Returns:
- the value of the
propagationBehavior
record component
-
timeout
Returns the value of thetimeout
record component.- Returns:
- the value of the
timeout
record component
-
readOnlyValue
Returns the value of thereadOnlyValue
record component.- Returns:
- the value of the
readOnlyValue
record component
-
annotationMetadata
@NonNull public @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata()Returns the value of theannotationMetadata
record component.- Returns:
- the value of the
annotationMetadata
record component
-