Package net.shibboleth.idp.saml.authn.principal

# Class NameIDPrincipal

java.lang.Object
net.shibboleth.idp.saml.authn.principal.NameIDPrincipal

All Implemented Interfaces:
  `Cloneable`, `Principal`, `CloneablePrincipal`

public class NameIDPrincipal extends Object implements CloneablePrincipal
Principal based on the SAML2 `NameID`.

## Field Summary

Fields
Modifier and Type
Field
Description
`private String`
`name`
Serialized form of NameID .
`private NameID`
`nameID`
The NameID.

## Constructor Summary

Constructors
Constructor
Description
`NameIDPrincipal(NameID theNameID)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`NameIDPrincipal`
`clone()`
Creates and returns a copy of this object.
`boolean`
`equals(Object other)`
`String`
`getName()`
`NameID`
`getNameID()`
Get the `NameID`.
`int`
`hashCode()`

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

`finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface java.security.Principal

`implies, toString`

## Field Details

### nameID

@Nonnull private NameID nameID
The NameID.

### name

@Nonnull @NotEmpty private String name
Serialized form of NameID .

## Constructor Details

### NameIDPrincipal

public NameIDPrincipal(@Nonnull @ParameterName(name="theNameID") NameID theNameID)
Constructor.

Parameters:
  `theNameID` - the NameID which is wrapped.

## Method Details

### getName

@Nonnull public String getName()

Specified by:
  `getName` in interface `Principal`

### getNameID

@Nonnull public NameID getNameID()
Get the `NameID`.

Returns:
  the nameID

### hashCode

public int hashCode()

Specified by:
  `hashCode` in interface `Principal`
Overrides:
  `hashCode` in class `Object`

### equals

public boolean equals(Object other)

Specified by:
  `equals` in interface `Principal`
Overrides:
  `equals` in class `Object`

### clone

@Nonnull public NameIDPrincipal clone() throws CloneNotSupportedException
Creates and returns a copy of this object.

Specified by:
  `clone` in interface `CloneablePrincipal`
Overrides:
  `clone` in class `Object`
Returns:
  a clone of this instance.
Throws:
  `CloneNotSupportedException` - if the instance cannot be cloned.
See Also:
  - `Object.clone()`