| 123456789101112131415161718192021222324252627 |
- package name.tflucke.ieat2.models;
- import java.util.Map;
- import org.mongodb.morphia.annotations.Entity;
- import org.mongodb.morphia.annotations.Transient;
- import org.mongodb.morphia.annotations.Indexed;
- import com.fasterxml.jackson.annotation.JsonProperty;
- @Entity("Food")
- public abstract class Food extends DBObject {
- @Indexed
- public String name;
- @JsonProperty("unit_type")
- public Unit.Type unitType = Unit.Type.mass;
- public Long calories_p_100;
- @JsonProperty("food_group")
- public String foodGroup;
- public boolean dry = unitType != Unit.Type.volume;
- public float density = 0;
- public Map<Short, Float> nutrients;
- public String getType() {
- return getClass().getSimpleName();
- }
- }
|