public abstract class AbstractKerberosDescriptor extends Object
Modifier and Type | Class and Description |
---|---|
static class |
AbstractKerberosDescriptor.Type
An enumeration of the different Kerberos (sub)descriptors for internal use.
|
Constructor and Description |
---|
AbstractKerberosDescriptor() |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object object) |
protected static Boolean |
getBooleanValue(Map<?,?> map,
String key)
Safely retrieves the requested value (converted to a Boolean) from the supplied Map
The found value will be converted to a Boolean using
Boolean.valueOf(String) . |
protected static Boolean |
getBooleanValue(Map<?,?> map,
String key,
Boolean defaultValue)
Safely retrieves the requested value (converted to a Boolean) from the supplied Map
The found value will be converted to a Boolean using
Boolean.valueOf(String) . |
protected AbstractKerberosDescriptor |
getDescriptor(AbstractKerberosDescriptor.Type type,
String name)
Gets the requested AbstractKerberosDescriptor implementation using a type name and a relevant
descriptor name.
|
String |
getName()
Returns the name of this descriptor
|
AbstractKerberosDescriptor |
getParent()
Returns the parent (or container) of this descriptor
|
String |
getPath()
Calculate the path to this identity descriptor for logging purposes.
|
protected AbstractKerberosDescriptor |
getRoot()
Traverses up the hierarchy to find the "root" or "parent" container.
|
protected static String |
getStringValue(Map<?,?> map,
String key)
Safely retrieves the requested value (converted to a String) from the supplied Map
The found value will be converted to a String using the
Object.toString() method. |
protected static Object |
getValue(Map<?,?> map,
String key)
Safely retrieves the requested value from the supplied Map
|
int |
hashCode() |
boolean |
isContainer()
Test this AbstractKerberosDescriptor to see if it is a container.
|
static <T> Collection<T> |
nullToEmpty(Collection<T> collection) |
static <T> List<T> |
nullToEmpty(List<T> list) |
static <K,V> Map<K,V> |
nullToEmpty(Map<K,V> collection) |
void |
setName(String name)
Sets the name of this descriptor
|
void |
setParent(AbstractKerberosDescriptor parent)
Sets the parent (or container) of this descriptor
|
Map<String,Object> |
toMap()
Generates a Map of data that represents this AbstractKerberosDescriptor implementation.
|
public Map<String,Object> toMap()
descriptor1 = AbstractKerberosDescriptorImpl(...) map = descriptor1.toMap() descriptor2 = AbstractKerberosDescriptor(map) descriptor1 should have the same data as descriptor2
public String getName()
public void setName(String name)
name
- a String indicating the name of this descriptorpublic AbstractKerberosDescriptor getParent()
public void setParent(AbstractKerberosDescriptor parent)
parent
- an AbstractKerberosDescriptor representing the parent (or container) of this
descriptor or null to clear the valuepublic boolean isContainer()
protected static Object getValue(Map<?,?> map, String key)
map
- a Map containing the relevant datakey
- a String declaring the item to retrieveprotected static String getStringValue(Map<?,?> map, String key)
Object.toString()
method.map
- a Map containing the relevant datakey
- a String declaring the item to retrieveprotected static Boolean getBooleanValue(Map<?,?> map, String key)
Boolean.valueOf(String)
.
If not found, null
will be returnedmap
- a Map containing the relevant datakey
- a String declaring the item to retrieveBoolean.valueOf(String)
,
getBooleanValue(Map, String, Boolean)
protected static Boolean getBooleanValue(Map<?,?> map, String key, Boolean defaultValue)
Boolean.valueOf(String)
.map
- a Map containing the relevant datakey
- a String declaring the item to retrievedefaultValue
- a Boolean value to return if the data is not foundBoolean.valueOf(String)
protected AbstractKerberosDescriptor getDescriptor(AbstractKerberosDescriptor.Type type, String name)
type
- a String indicating the type of the requested descriptorname
- a String indicating the name of the requested descriptorprotected AbstractKerberosDescriptor getRoot()
public static <T> Collection<T> nullToEmpty(Collection<T> collection)
public String getPath()
Copyright © 2022 Apache Software Foundation. All rights reserved.