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 only
- All Implemented Interfaces:
ConnectionDefinition
@Internal
public record DefaultConnectionDefinition(@Nullable String name, ConnectionDefinition.Propagation propagationBehavior, @Nullable Duration timeout, Boolean readOnlyValue)
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.data.connection.ConnectionDefinition
DEFAULT, PROPAGATION_DEFAULT, READ_ONLY, REQUIRES_NEW
-
Constructor Summary
ConstructorDescriptionDefaultConnectionDefinition
(@Nullable String name, ConnectionDefinition.Propagation propagationBehavior, @Nullable Duration timeout, Boolean readOnlyValue) Creates an instance of aDefaultConnectionDefinition
record class.DefaultConnectionDefinition
(ConnectionDefinition.Propagation propagationBehaviour) DefaultConnectionDefinition
(String name, boolean readOnly) -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.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.Connection definition with specific name.withPropagation
(ConnectionDefinition.Propagation propagation) Connection definition with specific propagation.
-
Constructor Details
-
DefaultConnectionDefinition
-
DefaultConnectionDefinition
-
DefaultConnectionDefinition
public DefaultConnectionDefinition(@Nullable @Nullable String name, ConnectionDefinition.Propagation propagationBehavior, @Nullable @Nullable Duration timeout, Boolean readOnlyValue) 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 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
-
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
-