Static Public Member Functions | Properties

GridGain.Client.Util.GridClientUtils Class Reference

Java client utils. More...

List of all members.

Static Public Member Functions

static byte[] ToBytes (Guid id)
 Converts Guid to a bytes array in Java format.
static Guid BytesToGuid (byte[] java, int off)
 Converts bytes array representation of Java UUID into C# Guid.
static byte[] ToBytes (short val)
 Converts primitive short type to byte array.
static byte[] ToBytes (int val)
 Converts primitive int type to byte array.
static byte[] ToBytes (long val)
 Converts primitive long type to byte array.
static byte[] ToBytes (float val)
 Converts primitive float type to byte array.
static byte[] ToBytes (double val)
 Converts primitive double type to byte array.
static short BytesToInt16 (byte[] buf, int off)
 Constructs short from byte array.
static int BytesToInt32 (byte[] buf, int off)
 Constructs int from byte array.
static long BytesToInt64 (byte[] buf, int off)
 Constructs long from byte array.
static float BytesToSingle (byte[] buf, int off)
 Constructs float from byte array.
static double BytesToDouble (byte[] buf, int off)
 Constructs double from byte array.
static IList< T > ApplyFilter< T > (IEnumerable< T > elements, Predicate< T > filter)
 Applies filter and returns filtered collection of nodes.
static Predicate< T > All< T > ()
 All predicate.
static Predicate< T > And< T > (Predicate< T > first, Predicate< T > second)
 AND predicate. Passes if and only if both provided filters accept the node. This filter uses short-term condition evaluation, i.e. second filter would not be invoked if first filter returned false.
static Predicate< T > Filter< T > (ICollection< T > inc, ICollection< T > exc)
 Filter predicate.
static Predicate< T > Contains< T > (ICollection< T > items)
 Creates a predicates that checks if given value is contained in the items collection.
static void DoSilent< TException > (Action job, Action< TException > handler)
 Do job and hide exception if happens.
static DateTime Timestamp (long timestamp)
 Convert unix timestamp (ms) into the DateTime object.
static bool Sleep (TimeSpan delay)
 Blocks the current thread for a specified time.
static IList< T > List< T > (params T[] array)
 Convert list of arguments into the list.
static IGridClientFuture< T > Async< T > (Func< T > func)
 Execute function in background thread.
static IGridClientFuture Async (Action action)
 Execute action in background thread.
static void AddAll< T > (this ICollection< T > collection, IEnumerable< T > newItems)
 Add all items from the passed collection to this one.
static IDictionary ToMap< TKey, TVal > (this IDictionary< TKey, TVal > source)
 Extend generic maps with conversions into not-generic ones.
static IDictionary< TKey, TVal > ToMap< TKey, TVal > (this IDictionary source)
 Extend base maps with conversions into generic ones.
static IDictionary< TKey, TVal > ToNullable< TKey, TVal > (this IDictionary< TKey, TVal > source)
 Wrap specified map with null-key allowed dictionary (if required).

Properties

static DateTime Now [get]
 Gets current date and time on this computer, expressed as the local time.
static DateTime Epoch [get]
 Unix epoch start point "1970-01-01 00:00:00.0 UTC" as the local time.

Detailed Description


Member Function Documentation

static void GridGain.Client.Util.GridClientUtils.AddAll< T > ( this ICollection< T >  collection,
IEnumerable< T >  newItems 
) [static]
Parameters:
collection This collection to add new items to.
newItems Collection of items to add to this one.
static Predicate<T> GridGain.Client.Util.GridClientUtils.All< T > (  )  [static]
Returns:
Always true-result predicate.
static Predicate<T> GridGain.Client.Util.GridClientUtils.And< T > ( Predicate< T >  first,
Predicate< T >  second 
) [static]
Parameters:
first First filter to check.
second Second filter to check.
Returns:
Conjunction predicate.
static IList<T> GridGain.Client.Util.GridClientUtils.ApplyFilter< T > ( IEnumerable< T >  elements,
Predicate< T >  filter 
) [static]
Parameters:
elements Nodes to be filtered.
filter Filter to apply
Returns:
Filtered collection.
Type Constraints
T :class 
static IGridClientFuture GridGain.Client.Util.GridClientUtils.Async ( Action  action  )  [static]
Parameters:
action Action to execute in background thread.
Returns:
Future to get action result.
static IGridClientFuture<T> GridGain.Client.Util.GridClientUtils.Async< T > ( Func< T >  func  )  [static]
Parameters:
func Function to execute in background thread.
Returns:
Future to get function result.
static double GridGain.Client.Util.GridClientUtils.BytesToDouble ( byte[]  buf,
int  off 
) [static]
Parameters:
buf Array of bytes.
off Offset in bytes array.
Returns:
Double value.
static Guid GridGain.Client.Util.GridClientUtils.BytesToGuid ( byte[]  java,
int  off 
) [static]
Parameters:
java Java UUID as bytes array.
off Offset in the bytes array.
Returns:
C# Guid.
static short GridGain.Client.Util.GridClientUtils.BytesToInt16 ( byte[]  buf,
int  off 
) [static]
Parameters:
buf Array of bytes.
off Offset in bytes array.
Returns:
Short value.
static int GridGain.Client.Util.GridClientUtils.BytesToInt32 ( byte[]  buf,
int  off 
) [static]
Parameters:
buf Array of bytes.
off Offset in bytes array.
Returns:
Integer value.
static long GridGain.Client.Util.GridClientUtils.BytesToInt64 ( byte[]  buf,
int  off 
) [static]
Parameters:
buf Array of bytes.
off Offset in bytes array.
Returns:
Long value.
static float GridGain.Client.Util.GridClientUtils.BytesToSingle ( byte[]  buf,
int  off 
) [static]
Parameters:
buf Array of bytes.
off Offset in bytes array.
Returns:
Float value.
static Predicate<T> GridGain.Client.Util.GridClientUtils.Contains< T > ( ICollection< T >  items  )  [static]
Parameters:
items Collection of valid items.
Returns:
Predicate.
static void GridGain.Client.Util.GridClientUtils.DoSilent< TException > ( Action  job,
Action< TException >  handler 
) [static]
Parameters:
job Job to execute.
handler Exception handler.
Type Constraints
TException :Exception 
static Predicate<T> GridGain.Client.Util.GridClientUtils.Filter< T > ( ICollection< T >  inc,
ICollection< T >  exc 
) [static]
static IList<T> GridGain.Client.Util.GridClientUtils.List< T > ( params T[]  array  )  [static]
Parameters:
array Variable arguments collection of items to add into list.
Returns:
List of the passed items.
static bool GridGain.Client.Util.GridClientUtils.Sleep ( TimeSpan  delay  )  [static]
Parameters:
delay Amount of time for which the thread is blocked.
Returns:
true if thread sleep was finished successfully, false if thread sleep was interrupted.
static DateTime GridGain.Client.Util.GridClientUtils.Timestamp ( long  timestamp  )  [static]
Returns:
DateTime object representing passed unix timestamp (ms).
static byte [] GridGain.Client.Util.GridClientUtils.ToBytes ( Guid  id  )  [static]
Parameters:
id Guid to convert.
Returns:
Converted Guid bytes in Java format.
static byte [] GridGain.Client.Util.GridClientUtils.ToBytes ( int  val  )  [static]
Parameters:
val Integer value.
Returns:
Array of bytes.
static byte [] GridGain.Client.Util.GridClientUtils.ToBytes ( long  val  )  [static]
Parameters:
val Long value.
Returns:
Array of bytes.
static byte [] GridGain.Client.Util.GridClientUtils.ToBytes ( double  val  )  [static]
Parameters:
val Double value.
Returns:
Array of bytes.
static byte [] GridGain.Client.Util.GridClientUtils.ToBytes ( short  val  )  [static]
Parameters:
val Short value.
Returns:
Array of bytes.
static byte [] GridGain.Client.Util.GridClientUtils.ToBytes ( float  val  )  [static]
Parameters:
val Float value.
Returns:
Array of bytes.
static IDictionary GridGain.Client.Util.GridClientUtils.ToMap< TKey, TVal > ( this IDictionary< TKey, TVal >  source  )  [static]
Parameters:
source Generic map to convert into not-generic one.
Returns:
Not-generic map.
static IDictionary<TKey, TVal> GridGain.Client.Util.GridClientUtils.ToMap< TKey, TVal > ( this IDictionary  source  )  [static]
Parameters:
source Not-generic map to convert into generic one.
Returns:
Generic map.
static IDictionary<TKey, TVal> GridGain.Client.Util.GridClientUtils.ToNullable< TKey, TVal > ( this IDictionary< TKey, TVal >  source  )  [static]
Parameters:
source Map to wrap with null-key allowed one.
Returns:
Null-key allowed map.

Property Documentation

DateTime GridGain.Client.Util.GridClientUtils.Epoch [static, get]
DateTime GridGain.Client.Util.GridClientUtils.Now [static, get]