Class SaslExtensions
- java.lang.Object
 - 
- org.apache.kafka.common.security.auth.SaslExtensions
 
 
- 
public class SaslExtensions extends Object
A simple immutable value object class holding customizable SASL extensions. Note on object identity and equality:SaslExtensionsintentionally overrides the standardequals(Object)andhashCode()methods calling their respectiveObject.equals(Object)andObject.hashCode()implementations. In so doing, it provides equality only via reference identity and will not base equality on the underlying values of itsextensions map. The reason for this approach to equality is based off of the manner in which credentials are stored in aSubject.SaslExtensionsare added to and removed from aSubjectvia itspublic credentials. The public credentials are stored in aSetin theSubject, so object equality therefore becomes a concern. With shallow, reference-based equality, distinctSaslExtensionsinstances with the same map values can be considered unique. This is critical to operations like token refresh. See KAFKA-14062 for more detail. 
- 
- 
Constructor Summary
Constructors Constructor Description SaslExtensions(Map<String,String> extensionsMap) 
- 
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SaslExtensionsempty()Creates an "empty" instance indicating no SASL extensions.booleanequals(Object o)Implements equals using the reference comparison implementation fromObject.equals(Object).inthashCode()ImplementshashCodeusing the native implementation fromObject.hashCode().Map<String,String>map()Returns an immutable map of the extension names and their valuesStringtoString() 
 - 
 
- 
- 
Method Detail
- 
map
public Map<String,String> map()
Returns an immutable map of the extension names and their values 
- 
empty
public static SaslExtensions empty()
Creates an "empty" instance indicating no SASL extensions. Do not cache the result of this method call for use by multipleSubjects as the references need to be unique. See the class-level documentation for details.- Returns:
 - Unique, but empty, 
SaslExtensionsinstance 
 
- 
equals
public final boolean equals(Object o)
Implements equals using the reference comparison implementation fromObject.equals(Object). See the class-level documentation for details. 
- 
hashCode
public final int hashCode()
ImplementshashCodeusing the native implementation fromObject.hashCode(). See the class-level documentation for details. 
 - 
 
 -