EnumTrait extends AbstractTrait implements ToSmithyBuilder<EnumTrait> { public boolean hasNames() { return definitions.stream().allMatch(body -> body.getName().isPresent()); } private  EnumTrait(Builder builder); List<EnumDefinition> getValues(); List<String> getEnumDefinitionValues(); boolean hasNames(); @Override Builder toBuilder(); static Builder builder(); static final ShapeId ID; }
@Test public void checksIfAllDefineNames() { Node node = Node.parse("[{\"value\": \"foo\", \"name\": \"FOO\"}, " + "{\"value\": \"bam\", \"name\": \"BAM\"}]"); EnumTrait trait = new EnumTrait.Provider().createTrait(ShapeId.from("ns.foo#baz"), node); assertThat(trait.hasNames(), is(true)); }