java.lang.Object
software.amazon.awssdk.services.s3.model.Redirect
All Implemented Interfaces:
Serializable, SdkPojo, ToCopyableBuilder<Redirect.Builder,Redirect>

@Generated("software.amazon.awssdk:codegen") public final class Redirect extends Object implements SdkPojo, Serializable, ToCopyableBuilder<Redirect.Builder,Redirect>

Specifies how requests are redirected. In the event of an error, you can specify a different error code to return.

See Also:
  • Method Details

    • hostName

      public final String hostName()

      The host name to use in the redirect request.

      Returns:
      The host name to use in the redirect request.
    • httpRedirectCode

      public final String httpRedirectCode()

      The HTTP redirect code to use on the response. Not required if one of the siblings is present.

      Returns:
      The HTTP redirect code to use on the response. Not required if one of the siblings is present.
    • protocol

      public final Protocol protocol()

      Protocol to use when redirecting requests. The default is the protocol that is used in the original request.

      If the service returns an enum value that is not available in the current SDK version, protocol will return Protocol.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from protocolAsString().

      Returns:
      Protocol to use when redirecting requests. The default is the protocol that is used in the original request.
      See Also:
    • protocolAsString

      public final String protocolAsString()

      Protocol to use when redirecting requests. The default is the protocol that is used in the original request.

      If the service returns an enum value that is not available in the current SDK version, protocol will return Protocol.UNKNOWN_TO_SDK_VERSION. The raw value returned by the service is available from protocolAsString().

      Returns:
      Protocol to use when redirecting requests. The default is the protocol that is used in the original request.
      See Also:
    • replaceKeyPrefixWith

      public final String replaceKeyPrefixWith()

      The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with KeyPrefixEquals set to docs/ and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided.

      Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints.

      Returns:
      The object key prefix to use in the redirect request. For example, to redirect requests for all pages with prefix docs/ (objects in the docs/ folder) to documents/, you can set a condition block with KeyPrefixEquals set to docs/ and in the Redirect set ReplaceKeyPrefixWith to /documents. Not required if one of the siblings is present. Can be present only if ReplaceKeyWith is not provided.

      Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints.

    • replaceKeyWith

      public final String replaceKeyWith()

      The specific object key to use in the redirect request. For example, redirect request to error.html. Not required if one of the siblings is present. Can be present only if ReplaceKeyPrefixWith is not provided.

      Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints.

      Returns:
      The specific object key to use in the redirect request. For example, redirect request to error.html. Not required if one of the siblings is present. Can be present only if ReplaceKeyPrefixWith is not provided.

      Replacement must be made for object keys containing special characters (such as carriage returns) when using XML requests. For more information, see XML related object key constraints.

    • toBuilder

      public Redirect.Builder toBuilder()
      Specified by:
      toBuilder in interface ToCopyableBuilder<Redirect.Builder,Redirect>
    • builder

      public static Redirect.Builder builder()
    • serializableBuilderClass

      public static Class<? extends Redirect.Builder> serializableBuilderClass()
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public final boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsBySdkFields

      public final boolean equalsBySdkFields(Object obj)
      Specified by:
      equalsBySdkFields in interface SdkPojo
    • toString

      public final String toString()
      Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be redacted from this string using a placeholder value.
      Overrides:
      toString in class Object
    • getValueForField

      public final <T> Optional<T> getValueForField(String fieldName, Class<T> clazz)
    • sdkFields

      public final List<SdkField<?>> sdkFields()
      Specified by:
      sdkFields in interface SdkPojo
    • sdkFieldNameToField

      public final Map<String,SdkField<?>> sdkFieldNameToField()
      Specified by:
      sdkFieldNameToField in interface SdkPojo