@Test public void keyValuesAreRefusedIfAnyBelongsToDifferentSchema() { try { personSchema.make( name.of("Dominic"), postcode.of("foo")); fail("Incorrect keys should not be accepted"); } catch (IllegalArgumentException e) { assertThat(e.getMessage(), equalTo("" + "Keys [TupleKey<name>,TupleKey<postcode>] " + "do not all belong to schema " + personSchema)); } }
public TupleKeyValue of(T value) { if (value == null) throw new IllegalArgumentException("value must not be null"); return new TupleKeyValue(this, value); }
TupleKey { public TupleKeyValue of(T value) { if (value == null) throw new IllegalArgumentException("value must not be null"); return new TupleKeyValue(this, value); } }
TupleKey { public TupleKeyValue of(T value) { if (value == null) throw new IllegalArgumentException("value must not be null"); return new TupleKeyValue(this, value); } TupleKey(TupleSchema schema, String name, int index); }
TupleKey { public TupleKeyValue of(T value) { if (value == null) throw new IllegalArgumentException("value must not be null"); return new TupleKeyValue(this, value); } TupleKey(TupleSchema schema, String name, int index); TupleKeyValue of(T value); String getName(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); }
TupleKey { public TupleKeyValue of(T value) { if (value == null) throw new IllegalArgumentException("value must not be null"); return new TupleKeyValue(this, value); } TupleKey(TupleSchema schema, String name, int index); TupleKeyValue of(T value); String getName(); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString();  }