Symbol extends TypedPropertiesBag implements SymbolContainer, SymbolDependencyContainer, ToSmithyBuilder<Symbol> { public static Builder builder() { return new Builder(); } private  Symbol(Builder builder); static Builder builder(); String getNamespace(); String getNamespaceDelimiter(); String getName(); String getDeclarationFile(); String getDefinitionFile(); String getFullName(); String relativize(String namespace); List<SymbolReference> getReferences(); @Override List<SymbolDependency> getDependencies(); @Override List<Symbol> getSymbols(); @Override Builder toBuilder(); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void getsTypedProperties() { Symbol symbol = Symbol.builder() .name("foo") .putProperty("baz", "bar") .putProperty("bam", 100) .build(); assertThat(symbol.expectProperty("baz", String.class), equalTo("bar")); assertThat(symbol.expectProperty("bam", Integer.class), equalTo(100)); }
@Test public void throwsIfExpectedPropertyIsNotPresent() { Assertions.assertThrows(IllegalArgumentException.class, () -> { Symbol symbol = Symbol.builder().name("foo").build(); symbol.expectProperty("baz"); }); }
@Test public void throwsIfExpectedPropertyIsNotOfSameType() { Assertions.assertThrows(IllegalArgumentException.class, () -> { Symbol symbol = Symbol.builder() .name("foo") .putProperty("bam", 100) .build(); symbol.expectProperty("bam", String.class); }); }