private String formatRequiredAttributesMessage() { List<String> attributes = new ArrayList<>(); if (!idIsSet()) attributes.add("id"); return "FooBarBaz in not initialized, some of the required attributes are not set " + attributes; }
/** * @return value of {@code id} attribute */ @Override public final int id() { if (!idIsSet()) { checkRequiredAttributes(); } return id; }
/** * Generates a string representation of this {@code FooBarBaz}. * If uninitialized, some attribute values may appear as question marks. * @return A string representation */ @Override public String toString() { return MoreObjects.toStringHelper("ModifiableFooBarBaz") .add("id", idIsSet() ? id() : "?") .add("foo", foo()) .add("bar", bar()) .add("baz", baz()) .toString(); } }