public class Authorizations extends Object implements Iterable<byte[]>, Serializable
Constructor and Description |
---|
Authorizations()
Constructs an empty set of authorizations.
|
Authorizations(byte[] authorizations)
Constructs an authorizations object a serialized form.
|
Authorizations(Collection<byte[]> authorizations)
A convenience constructor that accepts a collection of string authorizations that have each already been encoded as UTF-8 bytes.
|
Authorizations(List<ByteBuffer> authorizations)
A convenience constructor that accepts a collection of string authorizations that have each already been encoded as UTF-8 bytes.
|
Authorizations(String... authorizations)
Constructs an authorizations object from a set of human-readable authorizations.
|
Modifier and Type | Method and Description |
---|---|
boolean |
contains(byte[] auth)
Checks for the existence of this UTF-8 encoded authorization.
|
boolean |
contains(ByteSequence auth)
Checks for the existence of this UTF-8 encoded authorization.
|
boolean |
contains(String auth)
Checks for the existence of this authorization.
|
boolean |
equals(Object o) |
List<byte[]> |
getAuthorizations()
Retrieve authorizations as a list of strings that have been encoded as UTF-8 bytes.
|
byte[] |
getAuthorizationsArray()
Retrieve a serialized form of the underlying set of authorizations.
|
List<ByteBuffer> |
getAuthorizationsBB()
Retrieve authorizations as a list of strings that have been encoded as UTF-8 bytes.
|
int |
hashCode() |
boolean |
isEmpty() |
Iterator<byte[]> |
iterator() |
String |
serialize()
Returns a serialized form of these authorizations.
|
int |
size() |
String |
toString() |
public static final String HEADER
public Authorizations(Collection<byte[]> authorizations)
Authorizations(String...)
public Authorizations(List<ByteBuffer> authorizations)
Authorizations(String...)
public Authorizations(byte[] authorizations)
authorizations
- a serialized authorizations string produced by getAuthorizationsArray()
or serialize()
(converted to UTF-8 bytes)public Authorizations()
Authorizations(String...)
public Authorizations(String... authorizations)
authorizations
- array of authorizationspublic byte[] getAuthorizationsArray()
Authorizations(byte[])
public List<byte[]> getAuthorizations()
Authorizations(Collection)
public List<ByteBuffer> getAuthorizationsBB()
public boolean contains(byte[] auth)
public boolean contains(ByteSequence auth)
public boolean contains(String auth)
public int size()
public boolean isEmpty()
public String serialize()
Authorizations(byte[])
Copyright © 2011-2016 The Apache Software Foundation. All Rights Reserved.