private static long getExpiratioOffsetForType(BuildContext context, ObjectType objectType) { long expirationOffset = -1; for (TypeDeclaration type : context.getRuleBase().getTypeDeclarations()) { if (type.getObjectType().isAssignableFrom(objectType)) { expirationOffset = Math.max(type.getExpirationOffset(), expirationOffset); } } // if none of the type declarations have an @expires annotation // we return -1 (no-expiration) value, otherwise we return the // set expiration value+1 to enable the fact to match events with // the same timestamp return expirationOffset == -1 ? -1 : expirationOffset + 1; }