@Immutable public final class Audience extends Identifier
Provides helper methods for:
DEFAULT_BYTE_LENGTH
Constructor and Description |
---|
Audience(Identifier value)
Creates a new audience identifier with the specified value.
|
Audience(String value)
Creates a new audience identifier with the specified value.
|
Audience(URI value)
Creates a new audience identifier with the specified URI value.
|
Modifier and Type | Method and Description |
---|---|
static List<Audience> |
create(List<String> strings)
Creates an audience list from the specified string list
representation.
|
static List<Audience> |
create(String... strings)
Creates an audience list from the specified string array.
|
boolean |
equals(Object object) |
static boolean |
matchesAny(Collection<Audience> c1,
Collection<Audience> c2)
Returns
true if the specified collections have at at least
one matching audience value. |
List<Audience> |
toSingleAudienceList()
Returns a singleton list of this audience.
|
static List<String> |
toStringList(Audience audience)
Returns a string list representation of the specified audience.
|
static List<String> |
toStringList(List<Audience> audienceList)
Returns a string list representation of the specified audience list.
|
compareTo, getValue, hashCode, toJSONString, toString
public Audience(String value)
value
- The audience identifier value. Must not be null
or empty string.public Audience(URI value)
value
- The URI value. Must not be null
.public Audience(Identifier value)
value
- The value. Must not be null
.public List<Audience> toSingleAudienceList()
public boolean equals(Object object)
equals
in class Identifier
public static List<String> toStringList(Audience audience)
audience
- The audience. May be null
.null
if the argument was
null
.public static List<String> toStringList(List<Audience> audienceList)
audienceList
- The audience list. May be null
.null
if the argument was
null
.public static List<Audience> create(List<String> strings)
strings
- The string list. May be null
.null
if the argument was
null
.public static List<Audience> create(String... strings)
strings
- The strings. May be null
.null
if the argument was
null
.public static boolean matchesAny(Collection<Audience> c1, Collection<Audience> c2)
true
if the specified collections have at at least
one matching audience value.c1
- The first audience collection. May be null
.c2
- The second audience collection. May be null
.true
if the specified collections have at at least
one matching audience value, false
if there are no
matches or either collection is null
or empty.Copyright © 2016 Connect2id Ltd.. All Rights Reserved.