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
EMPTYFields inherited from interface io.micronaut.data.connection.ConnectionDefinition
DEFAULT, PROPAGATION_DEFAULT, READ_ONLY, REQUIRES_NEW -
Constructor Summary
ConstructorsConstructorDescriptionDefaultConnectionDefinition(@Nullable String name, ConnectionDefinition.Propagation propagationBehavior, @Nullable Duration timeout, Boolean readOnlyValue, @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata) Creates an instance of aDefaultConnectionDefinitionrecord 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.AnnotationMetadataReturns the value of theannotationMetadatarecord component.final booleanIndicates whether some other object is "equal to" this one.@NonNull io.micronaut.core.annotation.AnnotationMetadatagetName()Return the name of this connection.@NonNull ConnectionDefinition.PropagationReturn the propagation behavior.Return the connection timeout.final inthashCode()Returns a hash code value for this object.Return whether this is a read-only connection.@Nullable Stringname()Returns the value of thenamerecord component.Returns the value of thepropagationBehaviorrecord component.Returns the value of thereadOnlyValuerecord component.@Nullable Durationtimeout()Returns the value of thetimeoutrecord component.final StringtoString()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, waitMethods inherited from interface io.micronaut.core.annotation.AnnotationMetadataProvider
findAnnotation, findAnnotation, findDeclaredAnnotation, findDeclaredAnnotation, getTargetAnnotationMetadata, isAnnotationPresent, isDeclaredAnnotationPresent, synthesize, synthesizeAll, synthesizeAnnotationsByType, synthesizeDeclared, synthesizeDeclared, synthesizeDeclaredAnnotationsByTypeMethods 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 aDefaultConnectionDefinitionrecord class.- Parameters:
name- the value for thenamerecord componentpropagationBehavior- the value for thepropagationBehaviorrecord componenttimeout- the value for thetimeoutrecord componentreadOnlyValue- the value for thereadOnlyValuerecord componentannotationMetadata- the value for theannotationMetadatarecord component
-
-
Method Details
-
isReadOnly
Description copied from interface:ConnectionDefinitionReturn whether this is a read-only connection.- Specified by:
isReadOnlyin interfaceConnectionDefinition- Returns:
- The optional read only
-
getPropagationBehavior
Description copied from interface:ConnectionDefinitionReturn the propagation behavior.- Specified by:
getPropagationBehaviorin interfaceConnectionDefinition- Returns:
- The propagation behaviour
-
getTimeout
Description copied from interface:ConnectionDefinitionReturn the connection timeout.- Specified by:
getTimeoutin interfaceConnectionDefinition- Returns:
- The optional timeout
-
getName
Description copied from interface:ConnectionDefinitionReturn the name of this connection.- Specified by:
getNamein interfaceConnectionDefinition- Returns:
- The optional name
-
withPropagation
Description copied from interface:ConnectionDefinitionConnection definition with specific propagation.- Specified by:
withPropagationin interfaceConnectionDefinition- Parameters:
propagation- The new propagation- Returns:
- A new connection definition with specified propagation
-
withName
Description copied from interface:ConnectionDefinitionConnection definition with specific name.- Specified by:
withNamein 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:ConnectionDefinitionConnection definition with new annotation metadata.- Specified by:
withAnnotationMetadatain 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:
getAnnotationMetadatain 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 thenamerecord component.- Returns:
- the value of the
namerecord component
-
propagationBehavior
Returns the value of thepropagationBehaviorrecord component.- Returns:
- the value of the
propagationBehaviorrecord component
-
timeout
Returns the value of thetimeoutrecord component.- Returns:
- the value of the
timeoutrecord component
-
readOnlyValue
Returns the value of thereadOnlyValuerecord component.- Returns:
- the value of the
readOnlyValuerecord component
-
annotationMetadata
@NonNull public @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata()Returns the value of theannotationMetadatarecord component.- Returns:
- the value of the
annotationMetadatarecord component
-