public final class RiotApiUtil
extends java.lang.Object
Constructor and Description |
---|
RiotApiUtil() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
joinString(java.lang.CharSequence delimiter,
java.lang.CharSequence... elements)
Returns a new String composed of copies of the
elements joined together with a copy of the specified delimiter . |
static java.lang.String |
joinString(java.lang.CharSequence delimiter,
java.lang.Object... elements)
Returns a new String composed of copies of the
elements joined together with a copy of the specified delimiter . |
static java.lang.String |
normalizeSummonerName(java.lang.String summonerName)
Normalizes and returns a summoner name.
|
static <T> java.util.Map<java.lang.String,T> |
normalizeSummonerNames(java.util.Map<java.lang.String,T> summonerNames)
Normalizes and returns a map with summoner name keys.
|
static java.lang.String[] |
normalizeSummonerNames(java.lang.String... summonerNames)
Normalizes and returns an array of summoner names.
|
static java.lang.String |
requireValidSummonerName(java.lang.String summonerName)
Checks that the specified String is not an invalid summoner name.
|
public static java.lang.String normalizeSummonerName(java.lang.String summonerName)
String summonerName
to lower case and strips any
whitespaces.summonerName
- summoner namejava.lang.NullPointerException
- If summonerName
is null
public static java.lang.String[] normalizeSummonerNames(java.lang.String... summonerNames)
String[] summonerNames
to lower case and
strips any whitespaces.summonerNames
- summoner namesjava.lang.NullPointerException
- If summonerNames
is null
public static <T> java.util.Map<java.lang.String,T> normalizeSummonerNames(java.util.Map<java.lang.String,T> summonerNames)
Map<String, T> map
to lower case and
strips any whitespaces.summonerNames
- map with summoner name keysjava.lang.NullPointerException
- If summonerNames
is null
public static java.lang.String joinString(java.lang.CharSequence delimiter, java.lang.Object... elements)
elements
joined together with a copy of the specified delimiter
.
Note that if an element is null, then "null"
is added.delimiter
- the delimiter that separates each elementelements
- the elements to join togetherString
that is composed of the elements
separated by the delimiter
java.lang.NullPointerException
- If delimiter
or elements
is null
public static java.lang.String joinString(java.lang.CharSequence delimiter, java.lang.CharSequence... elements)
elements
joined together with a copy of the specified delimiter
.
Note that if an element is null, then "null"
is added.delimiter
- the delimiter that separates each elementelements
- the elements to join togetherString
that is composed of the elements
separated by the delimiter
java.lang.NullPointerException
- If delimiter
or elements
is null
public static java.lang.String requireValidSummonerName(java.lang.String summonerName) throws java.lang.IllegalArgumentException
RiotApi
to check the validity of a summoner name before firing a request to the Riot Api.summonerName
- The summoner name to to check for validitysummonerName
if not invalidjava.lang.IllegalArgumentException
- If summonerName
is not valid