Class OAuth1aTokenBuilder

java.lang.Object
com.linecorp.armeria.common.auth.OAuth1aTokenBuilder

public final class OAuth1aTokenBuilder
extends Object
Builds a new OAuth1aToken.
  • Method Details

    • realm

      public OAuth1aTokenBuilder realm​(String realm)
      Sets the value of the realm property.
    • consumerKey

      public OAuth1aTokenBuilder consumerKey​(String consumerKey)
      Sets the value of the oath_consumer_key property.
    • token

      public OAuth1aTokenBuilder token​(String token)
      Sets the value of the oauth_token property.
    • signatureMethod

      public OAuth1aTokenBuilder signatureMethod​(String signatureMethod)
      Sets the value of oauth_signature_method property.
    • signature

      public OAuth1aTokenBuilder signature​(String signature)
      Sets the value of oauth_signature property.
    • timestamp

      public OAuth1aTokenBuilder timestamp​(String timestamp)
      Sets the value of oauth_timestamp property.
    • nonce

      public OAuth1aTokenBuilder nonce​(String nonce)
      Sets the value of oauth_nonce property.
    • version

      public OAuth1aTokenBuilder version​(String version)
      Sets the value of oauth_version property. If not set, "1.0" is used by default.
    • put

      public OAuth1aTokenBuilder put​(String key, String value)
      Sets the specified key-value parameter. If the key is not one of the pre-defined parameters, then the key-value pair is set as an additional parameter. If the key is one of the pre-defined parameters, then the corresponding property is automatically set.
      
       OAuth1aToken.builder().put("oauth_signature_method", "foo");
       // is equivalent to
       OAuth1aToken.builder().signatureMethod("foo");
      
       // This is just an additional parameter.
       OAuth1aToken.builder().put("just_an_additional_parameter", "bar");
       
    • putAll

      public OAuth1aTokenBuilder putAll​(Map<String,​String> params)
      Sets the specified Map. If the key in the Map is not one of the pre-defined parameters, then the key-value pair is set as an additional parameter. If the key is one of the pre-defined parameters, then the corresponding property is automatically set.
      
       OAuth1aToken.builder().putAll(Map.of("oauth_signature_method", "foo"
                                            "oauth_signature", "bar"));
       // is equivalent to
       OAuth1aToken.builder().signatureMethod("foo")
                             .signature("bar");
       
    • build

      public OAuth1aToken build()
      Returns a newly-created OAuth1aToken based on the properties set so far.