boolean matchValidity = conditions.getValidityArray().length == 0;
Date now = new Date();
for (int i = 0; i < conditions.getValidityArray().length; i++)
{
ValidityType validity = conditions.getValidityArray(i);
for (int j = 0; j < validity.getFromArray().length; j++)
if (validity.getFromArray(j).after(now) && validity.getUntilArray(j).before(now))
matchValidity = true;
}
if (!matchValidity)
return false;