JUtils
A unity utilities library
JUtils.CollectionExtensions Class Reference

Static Public Member Functions

static bool IsEmptyOrNull< T > (this ICollection< T > self)
 Check if the collection is empty or null More...
 
static bool IsNotEmptyOrNull< T > (this ICollection< T > self)
 Check if the collection is empty or null More...
 
static bool IsEmpty< T > (this ICollection< T > self)
 Returns true if the collection is empty More...
 
static bool IsNotEmpty< T > (this ICollection< T > self)
 Returns true if the collection is filled More...
 
static T GetOrElse< T > (this ICollection< T > self, int index, T defaultValue)
 Try get the element at that index, else return the defaultValue More...
 
static void Shuffle< T > (this IList< T > self)
 Shuffles an list or array without creating a new one More...
 
static T PopRandom< T > (this List< T > self)
 Pop a random item from the list More...
 
static bool TryPopRandom< T > (this List< T > self, out T result)
 Pop a random item from the list More...
 

Member Function Documentation

◆ GetOrElse< T >()

static T JUtils.CollectionExtensions.GetOrElse< T > ( this ICollection< T >  self,
int  index,
defaultValue 
)
inlinestatic

Try get the element at that index, else return the defaultValue

◆ IsEmpty< T >()

static bool JUtils.CollectionExtensions.IsEmpty< T > ( this ICollection< T >  self)
inlinestatic

Returns true if the collection is empty

◆ IsEmptyOrNull< T >()

static bool JUtils.CollectionExtensions.IsEmptyOrNull< T > ( this ICollection< T >  self)
inlinestatic

Check if the collection is empty or null

◆ IsNotEmpty< T >()

static bool JUtils.CollectionExtensions.IsNotEmpty< T > ( this ICollection< T >  self)
inlinestatic

Returns true if the collection is filled

◆ IsNotEmptyOrNull< T >()

static bool JUtils.CollectionExtensions.IsNotEmptyOrNull< T > ( this ICollection< T >  self)
inlinestatic

Check if the collection is empty or null

◆ PopRandom< T >()

static T JUtils.CollectionExtensions.PopRandom< T > ( this List< T >  self)
inlinestatic

Pop a random item from the list

◆ Shuffle< T >()

static void JUtils.CollectionExtensions.Shuffle< T > ( this IList< T >  self)
inlinestatic

Shuffles an list or array without creating a new one

◆ TryPopRandom< T >()

static bool JUtils.CollectionExtensions.TryPopRandom< T > ( this List< T >  self,
out T  result 
)
inlinestatic

Pop a random item from the list


The documentation for this class was generated from the following file: