of

fun <T : Any> of(name: String): Attribute<T>(source)

构建一个 Attribute 实例。

Kotlin:

val attribute = Attribute.of<Foo>("foo")

Java:

final Attribute<Foo> foo = Attribute.of("foo");
final Attribute<Bar> bar = Attribute.of("bar", Bar.class);
Attribute.<Tar>of("tar"); // anonymous