Record Class DefaultConnectionDefinition

java.lang.Object
java.lang.Record
io.micronaut.data.connection.DefaultConnectionDefinition
Record Components:
name - The connection name
propagationBehavior - The propagation behaviour
timeout - The timeout
readOnlyValue - The read only
annotationMetadata - 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
  • Constructor Details

    • DefaultConnectionDefinition

      public DefaultConnectionDefinition(ConnectionDefinition.Propagation propagationBehaviour)
    • DefaultConnectionDefinition

      public DefaultConnectionDefinition(String name, boolean readOnly)
    • 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 a DefaultConnectionDefinition record class.
      Parameters:
      name - the value for the name record component
      propagationBehavior - the value for the propagationBehavior record component
      timeout - the value for the timeout record component
      readOnlyValue - the value for the readOnlyValue record component
      annotationMetadata - the value for the annotationMetadata record component
  • Method Details

    • isReadOnly

      public Optional<Boolean> isReadOnly()
      Description copied from interface: ConnectionDefinition
      Return whether this is a read-only connection.
      Specified by:
      isReadOnly in interface ConnectionDefinition
      Returns:
      The optional read only
    • getPropagationBehavior

      @NonNull public @NonNull ConnectionDefinition.Propagation getPropagationBehavior()
      Description copied from interface: ConnectionDefinition
      Return the propagation behavior.
      Specified by:
      getPropagationBehavior in interface ConnectionDefinition
      Returns:
      The propagation behaviour
    • getTimeout

      @NonNull public @NonNull Optional<Duration> getTimeout()
      Description copied from interface: ConnectionDefinition
      Return the connection timeout.
      Specified by:
      getTimeout in interface ConnectionDefinition
      Returns:
      The optional timeout
    • getName

      public String getName()
      Description copied from interface: ConnectionDefinition
      Return the name of this connection.
      Specified by:
      getName in interface ConnectionDefinition
      Returns:
      The optional name
    • withPropagation

      public ConnectionDefinition withPropagation(ConnectionDefinition.Propagation propagation)
      Description copied from interface: ConnectionDefinition
      Connection definition with specific propagation.
      Specified by:
      withPropagation in interface ConnectionDefinition
      Parameters:
      propagation - The new propagation
      Returns:
      A new connection definition with specified propagation
    • withName

      public ConnectionDefinition withName(String name)
      Description copied from interface: ConnectionDefinition
      Connection definition with specific name.
      Specified by:
      withName in interface ConnectionDefinition
      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 interface ConnectionDefinition
      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 interface io.micronaut.core.annotation.AnnotationMetadataProvider
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • name

      @Nullable public @Nullable String name()
      Returns the value of the name record component.
      Returns:
      the value of the name record component
    • propagationBehavior

      public ConnectionDefinition.Propagation propagationBehavior()
      Returns the value of the propagationBehavior record component.
      Returns:
      the value of the propagationBehavior record component
    • timeout

      @Nullable public @Nullable Duration timeout()
      Returns the value of the timeout record component.
      Returns:
      the value of the timeout record component
    • readOnlyValue

      public Boolean readOnlyValue()
      Returns the value of the readOnlyValue record component.
      Returns:
      the value of the readOnlyValue record component
    • annotationMetadata

      @NonNull public @NonNull io.micronaut.core.annotation.AnnotationMetadata annotationMetadata()
      Returns the value of the annotationMetadata record component.
      Returns:
      the value of the annotationMetadata record component