Add Saml2MessageBinding#from

Closes gh-9515
This commit is contained in:
Josh Cummings 2021-03-23 16:53:37 -06:00
parent aad76e68a2
commit a015b8b000
1 changed files with 14 additions and 0 deletions

View File

@ -43,4 +43,18 @@ public enum Saml2MessageBinding {
return this.urn;
}
/**
* Attempt to resolve the provided algorithm name to a {@code Saml2MessageBinding}.
* @param name the algorithm name
* @return the resolved {@code Saml2MessageBinding}, or {@code null} if not found
* @since 5.5
*/
public static Saml2MessageBinding from(String name) {
for (Saml2MessageBinding value : values()) {
if (value.getUrn().equals(name)) {
return value;
}
}
return null;
}
}