public class SecurityAuthorizations extends Object implements Iterable<byte[]>, Serializable
| Modifier and Type | Field and Description |
|---|---|
static SecurityAuthorizations |
EMPTY
An empty set of authorizations.
|
| Constructor and Description |
|---|
SecurityAuthorizations()
Constructs an empty set of authorizations.
|
SecurityAuthorizations(Collection<byte[]> authorizations)
Constructs an authorization object from a collection of string authorizations that have each already been encoded as UTF-8 bytes.
|
SecurityAuthorizations(List<ByteBuffer> authorizations)
Constructs an authorization object from a list of string authorizations that have each already been encoded as UTF-8 bytes.
|
SecurityAuthorizations(String... authorizations)
Constructs an authorizations object from a set of human-readable authorizations.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(byte[] auth)
Checks whether this object contains the given authorization.
|
boolean |
contains(ByteSequence auth)
Checks whether this object contains the given authorization.
|
boolean |
contains(String auth)
Checks whether this object contains the given authorization.
|
boolean |
equals(Object o) |
List<byte[]> |
getAuthorizations()
Gets the authorizations in sorted order.
|
List<ByteBuffer> |
getAuthorizationsBB()
Gets the authorizations in sorted order.
|
int |
hashCode() |
boolean |
isEmpty()
Checks if this collection of authorizations is empty.
|
Iterator<byte[]> |
iterator() |
int |
size()
Gets the size of this collection of authorizations.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic static final SecurityAuthorizations EMPTY
public SecurityAuthorizations(Collection<byte[]> authorizations)
authorizations - collection of authorizations, as strings encoded in UTF-8IllegalArgumentException - if authorizations is nullSecurityAuthorizations(String...)public SecurityAuthorizations(List<ByteBuffer> authorizations)
authorizations - list of authorizations, as strings encoded in UTF-8 and placed in buffersIllegalArgumentException - if authorizations is nullSecurityAuthorizations(String...)public SecurityAuthorizations()
SecurityAuthorizations(String...)public SecurityAuthorizations(String... authorizations)
authorizations - array of authorizationsIllegalArgumentException - if authorizations is nullpublic List<byte[]> getAuthorizations()
SecurityAuthorizations(Collection)public List<ByteBuffer> getAuthorizationsBB()
public boolean contains(byte[] auth)
auth - authorization, as a string encoded in UTF-8public boolean contains(ByteSequence auth)
auth - authorization, as a string encoded in UTF-8public boolean contains(String auth)
auth - authorizationpublic int size()
public boolean isEmpty()
Copyright © 2016–2021 MWARE SOLUTIONS. All rights reserved.