ApiKeyAuthentication Class

public final class ApiKeyAuthentication
extends RestRequestAuthentication

ApiKey authentication gives a name and a value that can be included in either the request header or query parameters.

Constructor Summary

Constructor Description
ApiKeyAuthentication()

Creates an instance of ApiKeyAuthentication class.

Method Summary

Modifier and Type Method and Description
RestAuthLocation in()

Get the in property: The location of the authentication key/value pair in the request.

String name()

Get the name property: The key name of the authentication key/value pair.

void validate()

Validates the instance.

String value()

Get the value property: The value of the authentication key/value pair.

ApiKeyAuthentication withIn(RestAuthLocation in)

Set the in property: The location of the authentication key/value pair in the request.

ApiKeyAuthentication withName(String name)

Set the name property: The key name of the authentication key/value pair.

ApiKeyAuthentication withValue(String value)

Set the value property: The value of the authentication key/value pair.

Methods inherited from RestRequestAuthentication

Methods inherited from java.lang.Object

Constructor Details

ApiKeyAuthentication

public ApiKeyAuthentication()

Creates an instance of ApiKeyAuthentication class.

Method Details

in

public RestAuthLocation in()

Get the in property: The location of the authentication key/value pair in the request.

Returns:

the in value.

name

public String name()

Get the name property: The key name of the authentication key/value pair.

Returns:

the name value.

validate

public void validate()

Validates the instance.

Overrides:

ApiKeyAuthentication.validate()

value

public String value()

Get the value property: The value of the authentication key/value pair.

Returns:

the value value.

withIn

public ApiKeyAuthentication withIn(RestAuthLocation in)

Set the in property: The location of the authentication key/value pair in the request.

Parameters:

in - the in value to set.

Returns:

the ApiKeyAuthentication object itself.

withName

public ApiKeyAuthentication withName(String name)

Set the name property: The key name of the authentication key/value pair.

Parameters:

name - the name value to set.

Returns:

the ApiKeyAuthentication object itself.

withValue

public ApiKeyAuthentication withValue(String value)

Set the value property: The value of the authentication key/value pair.

Parameters:

value - the value value to set.

Returns:

the ApiKeyAuthentication object itself.

Applies to