of

fun <T : Any> of(name: String, type: Class<T>): Attribute<T>

构建一个 Attribute 实例。


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

构建一个 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