@Test public void or() throws Exception { assertThat(Constraint.NULL.or(Constraint.UNDEFINED)).isEqualTo(Constraint.NULL_OR_UNDEFINED); assertThat(Constraint.FALSY.or(Constraint.TRUTHY)).isEqualTo(Constraint.ANY_VALUE); assertThat(Constraint.NULL.or(Constraint.TRUTHY)).isEqualTo(Constraint.TRUTHY.or(Constraint.NULL)); }
private static Constraint or(Constraint... constraints) { Preconditions.checkArgument(constraints.length > 0); Constraint constraint = constraints[0]; for (int i = 1; i < constraints.length; i++) { constraint = constraint.or(constraints[i]); } return constraint; }
Constraint { private static Constraint or(Constraint... constraints) { Preconditions.checkArgument(constraints.length > 0); Constraint constraint = constraints[0]; for (int i = 1; i < constraints.length; i++) { constraint = constraint.or(constraints[i]); } return constraint; } }
Constraint { private static Constraint or(Constraint... constraints) { Preconditions.checkArgument(constraints.length > 0); Constraint constraint = constraints[0]; for (int i = 1; i < constraints.length; i++) { constraint = constraint.or(constraints[i]); } return constraint; } private  Constraint(ValueSubSet subSet); private  Constraint(int bitSet); }
Constraint { private static Constraint or(Constraint... constraints) { Preconditions.checkArgument(constraints.length > 0); Constraint constraint = constraints[0]; for (int i = 1; i < constraints.length; i++) { constraint = constraint.or(constraints[i]); } return constraint; } private  Constraint(ValueSubSet subSet); private  Constraint(int bitSet); Constraint and(Constraint other); Constraint or(Constraint other); Constraint not(); Type type(); Optional<Range<Integer>> numericRange(); boolean isSingleValue(); Set<Type> typeSet(); boolean isStricterOrEqualTo(Constraint other); boolean isIncompatibleWith(Constraint other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
Constraint { private static Constraint or(Constraint... constraints) { Preconditions.checkArgument(constraints.length > 0); Constraint constraint = constraints[0]; for (int i = 1; i < constraints.length; i++) { constraint = constraint.or(constraints[i]); } return constraint; } private  Constraint(ValueSubSet subSet); private  Constraint(int bitSet); Constraint and(Constraint other); Constraint or(Constraint other); Constraint not(); Type type(); Optional<Range<Integer>> numericRange(); boolean isSingleValue(); Set<Type> typeSet(); boolean isStricterOrEqualTo(Constraint other); boolean isIncompatibleWith(Constraint other); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); static final Constraint ANY_VALUE; static final Constraint NO_POSSIBLE_VALUE; static final Constraint NULL; static final Constraint UNDEFINED; static final Constraint ZERO; static final Constraint EMPTY_STRING_PRIMITIVE; static final Constraint NAN; static final Constraint FALSE; static final Constraint TRUE; static final Constraint FUNCTION; static final Constraint POSITIVE_NUMBER_PRIMITIVE; static final Constraint NEGATIVE_NUMBER_PRIMITIVE; static final Constraint TRUTHY_STRING_PRIMITIVE; static final Constraint ARRAY; static final Constraint DATE; static final Constraint REGEXP; static final Constraint STRING_OBJECT; static final Constraint NUMBER_OBJECT; static final Constraint BOOLEAN_OBJECT; static final Constraint OTHER_OBJECT; static final Constraint NULL_OR_UNDEFINED; static final Constraint TRUTHY_NUMBER_PRIMITIVE; static final Constraint KNOWN_OBJECTS; static final Constraint NOT_NULLY; static final Constraint TRUTHY; static final Constraint FALSY; static final Constraint NUMBER_PRIMITIVE; static final Constraint ANY_NUMBER; static final Constraint STRING_PRIMITIVE; static final Constraint ANY_STRING; static final Constraint BOOLEAN_PRIMITIVE; static final Constraint ANY_BOOLEAN; static final Constraint OBJECT; }