public static boolean validate(long[] nums, int start, int length) { long max = Long.MIN_VALUE; for (int i = start; i < start + length; i++) { long n = nums[i]; Check.state(n > max, "Invalid numbers sequence, expected > " + max + ", found: " + n + " at " + (i - start) + " of " + length); max = n; } return true; }
@Override public JoinSide[] sides() { Check.state(sides != null, "Join is not initialized!"); return sides; }
public JoinBridgeImpl(Set<JoinBridgeRel> fromRels, Set<JoinBridgeRel> toRels) { this.fromRels = fromRels; this.toRels = toRels; for (JoinBridgeRel bridgeRel : fromRels) { Check.arg(bridgeRel.mode == JoinMode.INNER || bridgeRel.mode == JoinMode.RIGHT_OUTER, "wrong join type!"); } for (JoinBridgeRel bridgeRel : toRels) { Check.arg(bridgeRel.mode == JoinMode.INNER || bridgeRel.mode == JoinMode.LEFT_OUTER, "wrong join type!"); } }
@Override public void kind(boolean symmetric, boolean manyFroms, boolean manyTos) { if (hasKind) { Check.state(this.symmetric == symmetric); Check.state(this.manyFroms == manyFroms); Check.state(this.manyTos == manyTos); } else { this.symmetric = symmetric; this.manyFroms = manyFroms; this.manyTos = manyTos; this.hasKind = true; } }
@Override public void kind(boolean symmetric, boolean manyFroms, boolean manyTos) { if (hasKind) { Check.state(this.symmetric == symmetric); Check.state(this.manyFroms == manyFroms); Check.state(this.manyTos == manyTos); } else { this.symmetric = symmetric; this.manyFroms = manyFroms; this.manyTos = manyTos; this.hasKind = true; } }
public JoinBridgeImpl(Set<JoinBridgeRel> fromRels, Set<JoinBridgeRel> toRels) { this.fromRels = fromRels; this.toRels = toRels; for (JoinBridgeRel bridgeRel : fromRels) { Check.arg(bridgeRel.mode == JoinMode.INNER || bridgeRel.mode == JoinMode.RIGHT_OUTER, "wrong join type!"); } for (JoinBridgeRel bridgeRel : toRels) { Check.arg(bridgeRel.mode == JoinMode.INNER || bridgeRel.mode == JoinMode.LEFT_OUTER, "wrong join type!"); } }
private long only(long[] array) { Check.state(array.length <= 1, "Expected at most 1 element!"); return array.length == 1 ? array[0] : -1; }
public JoinBridgeImpl(Set<JoinBridgeRel> fromRels, Set<JoinBridgeRel> toRels) { this.fromRels = fromRels; this.toRels = toRels; for (JoinBridgeRel bridgeRel : fromRels) { Check.arg(bridgeRel.mode == JoinMode.INNER || bridgeRel.mode == JoinMode.RIGHT_OUTER, "wrong join type!"); } for (JoinBridgeRel bridgeRel : toRels) { Check.arg(bridgeRel.mode == JoinMode.INNER || bridgeRel.mode == JoinMode.LEFT_OUTER, "wrong join type!"); } }
public SearchFutureIds(Search<?> search) { Check.notNull(search, "search criteria"); this.search = search; }
public static Links ln(Links[] links) { Check.state(links.length == 1); return links[0]; }