public Customer(Draft draft) { checkArgument( Draft.Entity.CUSTOMERS.equals(draft.entity()), "expected CUSTOMERS draft, but got %s", draft.entity()); this.id = new CustomerId(draft.entityId()); this.props = propsFromDraft(draft); this.record = recordFromProps(); }
private void checkDraftEntityIs(final Draft.Entity entity, final Draft draft) { checkState( entity.equals(draft.entity()), "expected '%s' draft, but got '%s'", entity, draft.entity()); }