Maven module :un.api : api-common :
Class : un.api.CObjects
Extends/Implements : -
Subclasses : -

Convinient functions on objects.
author  Johann Sorel


Variables : -
Functions : toChars, toChars, equals, equals, ensureNotNull, ensureNotNull, ensureBetween, ensurePositive, ensureNegative



public Chars toChars (Object object)


param  object
param  arrayLength maximum number of values in array displayed
return
public Chars toChars (Object object, int arrayLength)

public boolean equals (Object first, Object second)


Compare two objects.
Check for possible null.
param  first first object to compare
param  second second object to compare
return  true if both objects are equal or null
public boolean equals (CObject first, CObject second)


Ensure given object is not null.
Raise error otherwise.
param  candidate object to test
throws  IllegalArgumentException if tested object is null
public void ensureNotNull (Object candidate)


Ensure given object is not null.
Raise error otherwise.
param  candidate object to test
throws  IllegalArgumentException if tested object is null
public void ensureNotNull (Object candidate, String name)


Ensure given value is in given range.
Raise error otherwise.
param  candidate value to test
param  min lower range
param  max upper range
throws  IllegalArgumentException if value is not between bounds
public void ensureBetween (double candidate, double min, double max)


Ensure given value is positive
Raise error otherwise.
param  candidate value to test
throws  IllegalArgumentException if value is not positive
public void ensurePositive (double candidate)


Ensure given value is negative
Raise error otherwise.
param  candidate value to test
throws  IllegalArgumentException if value is not negative
public void ensureNegative (double candidate)