Package net.shibboleth.idp.attribute.resolver.dc

# Class AbstractMappingStrategy<T>

java.lang.Object
net.shibboleth.idp.attribute.resolver.dc.AbstractMappingStrategy<T>

Type Parameters:
  `T` - The type of result.

All Implemented Interfaces:
  `MappingStrategy<T>`

Direct Known Subclasses:
  `StringAttributeValueMappingStrategy`, `StringResultMappingStrategy`

public abstract class AbstractMappingStrategy<T> extends Object implements MappingStrategy<T>
Base class for implementing `MappingStrategy` instances that includes support for field renaming/aliasing.

## Field Summary

Fields
Modifier and Type
Field
Description
`private boolean`
`multipleResultsAnError`
Whether a result set with more than one result is an error.
`private boolean`
`noResultAnError`
Whether an empty result set is an error.
`private Map<String,String>`
`resultRenamingMap`
A map to rename result fields.

## Constructor Summary

Constructors
Constructor
Description
`AbstractMappingStrategy()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`Map<String,String>`
`getResultRenamingMap()`
Get an unmodifiable view of a map of aliasing rules.
`boolean`
`isMultipleResultsAnError()`
Gets whether multiple results is treated as an error.
`boolean`
`isNoResultAnError()`
Gets whether an empty result set is treated as an error.
`void`
`setMultipleResultsAnError(boolean isAnError)`
Sets whether multiple results is treated as an error.
`void`
`setNoResultAnError(boolean isAnError)`
Sets whether an empty result set is treated as an error.
`void`
`setResultRenamingMap(Map<String,String> map)`
Set the map of aliasing rules.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.shibboleth.idp.attribute.resolver.dc.MappingStrategy

`map`

## Field Details

### resultRenamingMap

@Nonnull private Map<String,String> resultRenamingMap
A map to rename result fields.

### noResultAnError

private boolean noResultAnError
Whether an empty result set is an error.

### multipleResultsAnError

private boolean multipleResultsAnError
Whether a result set with more than one result is an error.

## Constructor Details

### AbstractMappingStrategy

public AbstractMappingStrategy()
Constructor.

## Method Details

### getResultRenamingMap

@Nonnull @Unmodifiable @NotLive public Map<String,String> getResultRenamingMap()
Get an unmodifiable view of a map of aliasing rules.

Returns:
  a map of result field names to alternate field names

### setResultRenamingMap

public void setResultRenamingMap(@Nonnull Map<String,String> map)
Set the map of aliasing rules.

Parameters:
  `map` - map of result field names to alternate field names

### isNoResultAnError

public boolean isNoResultAnError()
Gets whether an empty result set is treated as an error.

Returns:
  whether an empty result set is treated as an error

### setNoResultAnError

public void setNoResultAnError(boolean isAnError)
Sets whether an empty result set is treated as an error.

Parameters:
  `isAnError` - whether an empty result set is treated as an error

### isMultipleResultsAnError

public boolean isMultipleResultsAnError()
Gets whether multiple results is treated as an error.

Returns:
  whether multiple results is treated as an error

### setMultipleResultsAnError

public void setMultipleResultsAnError(boolean isAnError)
Sets whether multiple results is treated as an error.

Parameters:
  `isAnError` - whether multiple results is treated as an error