@Test public void testAttributeInitializer() { AttributeDefinition<Properties> def = AttributeDefinition.builder("props", null, Properties.class).initializer(new AttributeInitializer<Properties>() { @Override public Properties initialize() { return new Properties(); } }).build(); Attribute<Properties> attribute1 = def.toAttribute(); Attribute<Properties> attribute2 = def.toAttribute(); assertTrue(attribute1.get() != attribute2.get()); }
public T get() { return value; }
Attribute implements Cloneable, Matchable<Attribute<?>> { public T get() { return value; } }
Attribute implements Cloneable, Matchable<Attribute<?>> { public T get() { return value; } Attribute(AttributeDefinition<T> definition); }
Attribute implements Cloneable, Matchable<Attribute<?>> { public T get() { return value; } Attribute(AttributeDefinition<T> definition); String name(); T get(); T getInitialValue(); void validate(); Attribute<T> protect(); void set(T value); T computeIfAbsent(Supplier<T> supplier); boolean isImmutable(); boolean isPersistent(); boolean isModified(); K asObject(); void addListener(AttributeListener<T> listener); void removeListener(AttributeListener<T> listener); boolean isNull(); AttributeDefinition<T> getAttributeDefinition(); void read(Attribute<T> other); @Override int hashCode(); @Override boolean equals(Object obj); boolean matches(Attribute<?> other); @Override String toString(); void reset(); }
Attribute implements Cloneable, Matchable<Attribute<?>> { public T get() { return value; } Attribute(AttributeDefinition<T> definition); String name(); T get(); T getInitialValue(); void validate(); Attribute<T> protect(); void set(T value); T computeIfAbsent(Supplier<T> supplier); boolean isImmutable(); boolean isPersistent(); boolean isModified(); K asObject(); void addListener(AttributeListener<T> listener); void removeListener(AttributeListener<T> listener); boolean isNull(); AttributeDefinition<T> getAttributeDefinition(); void read(Attribute<T> other); @Override int hashCode(); @Override boolean equals(Object obj); boolean matches(Attribute<?> other); @Override String toString(); void reset();  }