use of org.qi4j.api.property.Property in project qi4j-sdk by Qi4j.
the class EntityStateInstance method propertyFor.
@Override
@SuppressWarnings("unchecked")
public <T> Property<T> propertyFor(AccessibleObject accessor) throws IllegalArgumentException {
Map<AccessibleObject, Object> state = state();
Property<T> property = (Property<T>) state.get(accessor);
if (property == null) {
PropertyModel entityPropertyModel = stateModel.propertyModelFor(accessor);
property = new EntityPropertyInstance<>(entityState instanceof BuilderEntityState ? entityPropertyModel.getBuilderInfo() : entityPropertyModel, entityState);
state.put(accessor, property);
}
return property;
}
Aggregations