Record Class S3Config

java.lang.Object
java.lang.Record
br.com.xadm.comum.armazenamento.S3Config
Record Components:
endpoint - URL do endpoint S3.
region - região S3 (deve bater com o servidor; default garage).
accessKey - access key.
secretKey - secret key.
bucket - bucket dedicado deste app.
criarBucket - se true, cria o bucket no startup quando ausente.

@ConfigurationProperties("s3") public record S3Config(String endpoint, String region, String accessKey, String secretKey, String bucket, boolean criarBucket) extends Record
Configuração do object storage S3-compatível (Garage) — prefixo s3.*.

Binding relaxado: s3.access-key → accessKey(), s3.criar-bucket → criarBucket().

  • Constructor Details

    • S3Config

      public S3Config(String endpoint, @Bindable(defaultValue="garage") String region, String accessKey, String secretKey, String bucket, @Bindable(defaultValue="false") boolean criarBucket)
      Creates an instance of a S3Config record class.
      Parameters:
      endpoint - the value for the endpoint record component
      region - the value for the region record component
      accessKey - the value for the accessKey record component
      secretKey - the value for the secretKey record component
      bucket - the value for the bucket record component
      criarBucket - the value for the criarBucket record component
  • Method Details

    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • endpoint

      public String endpoint()
      Returns the value of the endpoint record component.
      Returns:
      the value of the endpoint record component
    • region

      @Bindable(defaultValue="garage") public String region()
      Returns the value of the region record component.
      Returns:
      the value of the region record component
    • accessKey

      public String accessKey()
      Returns the value of the accessKey record component.
      Returns:
      the value of the accessKey record component
    • secretKey

      public String secretKey()
      Returns the value of the secretKey record component.
      Returns:
      the value of the secretKey record component
    • bucket

      public String bucket()
      Returns the value of the bucket record component.
      Returns:
      the value of the bucket record component
    • criarBucket

      @Bindable(defaultValue="false") public boolean criarBucket()
      Returns the value of the criarBucket record component.
      Returns:
      the value of the criarBucket record component