Package org.opensaml.saml.metadata.support

# Class SAML2MetadataSupport

java.lang.Object
org.opensaml.saml.metadata.support.SAML2MetadataSupport

public final class SAML2MetadataSupport extends Object
Utility helper class for SAML 2 metadata objects.

## Field Summary

Fields
Modifier and Type
Field
Description
`private static final org.slf4j.Logger`
`LOG`
Logger.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`SAML2MetadataSupport()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`static <T extends IndexedEndpoint>
T`
`getDefaultIndexedEndpoint(List<T> candidates)`
Select the default `IndexedEndpoint` from a list of candidates.

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

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

## Field Details

### LOG

@Nonnull private static final org.slf4j.Logger LOG
Logger.

## Constructor Details

### SAML2MetadataSupport

private SAML2MetadataSupport()
Constructor.

## Method Details

### getDefaultIndexedEndpoint

@Nullable public static <T extends IndexedEndpoint> T getDefaultIndexedEndpoint(List<T> candidates)
Select the default `IndexedEndpoint` from a list of candidates.

The algorithm used is:

1. Select the first endpoint with an explicit `isDefault=true`
2. Select the first endpoint with no explicit `isDefault`
3. Select the first endpoint

Type Parameters:
  `T` - the subtype of IndexedType
Parameters:
  `candidates` - the list of candidate indexed endpoints
Returns:
  the selected candidate (or null if the list is null or empty)