Module java.base
Package javax.security.auth

# Class Subject

=
public final class Subject
extends java.lang.Object
implements java.io.Serializable

## Constructors

- =
  public Subject()
- =
  public Subject(boolean arg0, java.util.Set<? extends java.security.Principal> arg1, java.util.Set<?> arg2, java.util.Set<?> arg3)

## Methods

- =
  public static <T> T callAs(javax.security.auth.Subject arg0, java.util.concurrent.Callable<T> arg1) throws java.util.concurrent.CompletionException
- =
  public static javax.security.auth.Subject current()
- =
  @Deprecated(since="18"forRemoval=true)
  public static <T> T doAs(javax.security.auth.Subject arg0, java.security.PrivilegedAction<T> arg1)
- =
  @Deprecated(since="18"forRemoval=true)
  public static <T> T doAs(javax.security.auth.Subject arg0, java.security.PrivilegedExceptionAction<T> arg1) throws java.security.PrivilegedActionException
- =
  @Deprecated(since="17"forRemoval=true)
  public static <T> T doAsPrivileged(javax.security.auth.Subject arg0, java.security.PrivilegedAction<T> arg1, java.security.AccessControlContext arg2)
- =
  @Deprecated(since="17"forRemoval=true)
  public static <T> T doAsPrivileged(javax.security.auth.Subject arg0, java.security.PrivilegedExceptionAction<T> arg1, java.security.AccessControlContext arg2) throws java.security.PrivilegedActionException
- =
  public boolean equals(java.lang.Object arg0)
- =
  public java.util.Set<java.security.Principal> getPrincipals()
- =
  public <T> java.util.Set<T> getPrincipals(java.lang.Class<T> arg0)
- =
  public java.util.Set<java.lang.Object> getPrivateCredentials()
- =
  public <T> java.util.Set<T> getPrivateCredentials(java.lang.Class<T> arg0)
- =
  public java.util.Set<java.lang.Object> getPublicCredentials()
- =
  public <T> java.util.Set<T> getPublicCredentials(java.lang.Class<T> arg0)
- =
  @Deprecated(since="17"forRemoval=true)
  public static javax.security.auth.Subject getSubject(java.security.AccessControlContext arg0)
- =
  public int hashCode()
- =
  public boolean isReadOnly()
- =
  public void setReadOnly()
- =
  public java.lang.String toString()

## Serialized Form

=

### serialVersionUID

=-8308522755600156056

### Serialized Fields

- =
  java.util.Set<java.security.Principal> principals
- =
  boolean readOnly

### Serialization Methods

- =
  private void readObject(java.io.ObjectInputStream arg0) throws java.io.IOException, java.lang.ClassNotFoundException
- =
  private void writeObject(java.io.ObjectOutputStream arg0) throws java.io.IOException

## Summary

No differences.