Package org.opensaml.saml.common
Class SAMLVersion
- java.lang.Object
-
- org.opensaml.saml.common.SAMLVersion
-
public final class SAMLVersion extends Object
A type safe SAML version enumeration.
-
-
Field Summary
Fields Modifier and Type Field Description private intmajorVersionMajor version number.private intminorVersionMinor version number.static SAMLVersionVERSION_10SAML version 1.0.static SAMLVersionVERSION_11SAML Version 1.1.static SAMLVersionVERSION_20SAML Version 2.0.private StringversionStringString representation of the version.
-
Constructor Summary
Constructors Modifier Constructor Description privateSAMLVersion(int major, int minor)Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetMajorVersion()Gets the major version of the SAML version.intgetMinorVersion()Gets the minor version of the SAML version.StringtoString()static SAMLVersionvalueOf(int majorVersion, int minorVersion)Gets the SAMLVersion given the major and minor version number.static SAMLVersionvalueOf(String version)Gets the SAMLVersion for a given version string, such as "2.0".
-
-
-
Field Detail
-
VERSION_10
@Nonnull public static final SAMLVersion VERSION_10
SAML version 1.0.
-
VERSION_11
@Nonnull public static final SAMLVersion VERSION_11
SAML Version 1.1.
-
VERSION_20
@Nonnull public static final SAMLVersion VERSION_20
SAML Version 2.0.
-
majorVersion
private final int majorVersion
Major version number.
-
minorVersion
private final int minorVersion
Minor version number.
-
-
Method Detail
-
valueOf
public static final SAMLVersion valueOf(int majorVersion, int minorVersion)
Gets the SAMLVersion given the major and minor version number.- Parameters:
majorVersion- major version numberminorVersion- minor version number- Returns:
- the SAMLVersion
-
valueOf
public static final SAMLVersion valueOf(@Nonnull String version)
Gets the SAMLVersion for a given version string, such as "2.0".- Parameters:
version- SAML version string- Returns:
- SAMLVersion for the given string
-
getMajorVersion
public int getMajorVersion()
Gets the major version of the SAML version.- Returns:
- the major version of the SAML version
-
getMinorVersion
public int getMinorVersion()
Gets the minor version of the SAML version.- Returns:
- the minor version of the SAML version
-
-