Class UserAgentConstant
- java.lang.Object
-
- software.amazon.awssdk.core.internal.useragent.UserAgentConstant
-
public final class UserAgentConstant extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPI_METADATAstatic StringAPP_IDstatic StringAUTH_SOURCEstatic StringCONFIG_METADATAstatic StringENV_METADATAstatic StringFEATURE_METADATAstatic StringFRAMEWORK_METADATAstatic StringHASHstatic StringHTTPstatic StringINTERNAL_METADATA_MARKERstatic StringIOstatic StringJAVA_SDK_METADATAstatic StringLANG_METADATAstatic StringMETADATAstatic StringOS_METADATAstatic StringRETRY_MODEstatic StringSLASHstatic StringSPACEstatic StringUA_METADATA
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidappendFieldAndSpace(StringBuilder builder, String name, String value)Add a metadata field to the string builder, followed by space.static voidappendNonEmptyField(StringBuilder builder, String name, String value)Add a metadata field to the string builder only if 'value' is non-empty.static voidappendSpaceAndField(StringBuilder builder, String name, String value)Add a metadata field to the string builder, preceded by space.static Stringconcat(String prefix, String suffix, String separator)Concatenates two values with the specified separator, if the second value is not null/empty, otherwise returns the first value.static Stringfield(String name, String value)According to specifications, the SDK user agent consists of metadata fields separated by RWS characters - in this implementation, space.static StringsanitizeInput(String input)Replace any spaces, parentheses in the input with underscores.static StringuaPair(String name, String value)According to specifications, an SDK user agent pair is a name, value pair concatenated with a '#' (HASH).static StringuaPairOrNull(String name, String value)According to specifications, an SDK user agent pair is a name, value pair concatenated with a '#' (HASH).
-
-
-
Field Detail
-
API_METADATA
public static final String API_METADATA
- See Also:
- Constant Field Values
-
OS_METADATA
public static final String OS_METADATA
- See Also:
- Constant Field Values
-
LANG_METADATA
public static final String LANG_METADATA
- See Also:
- Constant Field Values
-
UA_METADATA
public static final String UA_METADATA
- See Also:
- Constant Field Values
-
ENV_METADATA
public static final String ENV_METADATA
- See Also:
- Constant Field Values
-
JAVA_SDK_METADATA
public static final String JAVA_SDK_METADATA
- See Also:
- Constant Field Values
-
FEATURE_METADATA
public static final String FEATURE_METADATA
- See Also:
- Constant Field Values
-
CONFIG_METADATA
public static final String CONFIG_METADATA
- See Also:
- Constant Field Values
-
FRAMEWORK_METADATA
public static final String FRAMEWORK_METADATA
- See Also:
- Constant Field Values
-
METADATA
public static final String METADATA
- See Also:
- Constant Field Values
-
INTERNAL_METADATA_MARKER
public static final String INTERNAL_METADATA_MARKER
- See Also:
- Constant Field Values
-
APP_ID
public static final String APP_ID
- See Also:
- Constant Field Values
-
SLASH
public static final String SLASH
- See Also:
- Constant Field Values
-
HASH
public static final String HASH
- See Also:
- Constant Field Values
-
SPACE
public static final String SPACE
- See Also:
- Constant Field Values
-
IO
public static final String IO
- See Also:
- Constant Field Values
-
HTTP
public static final String HTTP
- See Also:
- Constant Field Values
-
RETRY_MODE
public static final String RETRY_MODE
- See Also:
- Constant Field Values
-
AUTH_SOURCE
public static final String AUTH_SOURCE
- See Also:
- Constant Field Values
-
-
Method Detail
-
field
public static String field(String name, String value)
According to specifications, the SDK user agent consists of metadata fields separated by RWS characters - in this implementation, space. Each field is represented by the name of the field, as specified and the contents of the field, separated with a '/' (SLASH). Contents can be a single token, a specified value or a uaPair.
-
uaPair
public static String uaPair(String name, String value)
According to specifications, an SDK user agent pair is a name, value pair concatenated with a '#' (HASH).
-
uaPairOrNull
public static String uaPairOrNull(String name, String value)
According to specifications, an SDK user agent pair is a name, value pair concatenated with a '#' (HASH).
-
appendFieldAndSpace
public static void appendFieldAndSpace(StringBuilder builder, String name, String value)
Add a metadata field to the string builder, followed by space. If 'value' can be empty, useappendNonEmptyField(StringBuilder, String, String)instead.
-
appendSpaceAndField
public static void appendSpaceAndField(StringBuilder builder, String name, String value)
Add a metadata field to the string builder, preceded by space. If 'value' can be empty, useappendNonEmptyField(StringBuilder, String, String)instead.
-
appendNonEmptyField
public static void appendNonEmptyField(StringBuilder builder, String name, String value)
Add a metadata field to the string builder only if 'value' is non-empty. Also seeappendFieldAndSpace(StringBuilder, String, String)
-
sanitizeInput
public static String sanitizeInput(String input)
Replace any spaces, parentheses in the input with underscores.
-
-