/** * Constructor. * * @param value singleton resource */ public Data(T value) { this.values = new SingleElementSet<>(value); this.relationshipType = RelationshipType.MANY_TO_ONE; // Any "toOne" }
/** * Fetch the item if the data is toOne. * * @return T if toOne * @throws IllegalAccessError when the data is not toOne */ public T getSingleValue() { if (isToOne()) { return ((SingleElementSet<T>) values).getValue(); } throw new IllegalAccessError("Data is not toOne"); }
/** * Constructor. * * @param value singleton resource */ public Data(T value) { this.values = new SingleElementSet<>(value); this.relationshipType = RelationshipType.MANY_TO_ONE; // Any "toOne" }
/** * Fetch the item if the data is toOne. * * @return T if toOne * @throws IllegalAccessError when the data is not toOne */ public T getSingleValue() { if (isToOne()) { return ((SingleElementSet<T>) values).getValue(); } throw new IllegalAccessError("Data is not toOne"); }
resources = new PersistentResourceSet(this, filteredVal, requestScope); } else if (type.isToOne()) { resources = new SingleElementSet( new PersistentResource(val, this, requestScope.getUUIDFor(val), requestScope)); } else {
PersistentResource record = ((SingleElementSet<PersistentResource>) collection).getValue(); nextState = new RecordTerminalState(record, collectionTerminalState); } else {
resources = new PersistentResourceSet(this, filteredVal, requestScope); } else if (type.isToOne()) { resources = new SingleElementSet( new PersistentResource(val, this, requestScope.getUUIDFor(val), requestScope)); } else {
PersistentResource record = ((SingleElementSet<PersistentResource>) collection).getValue(); nextState = new RecordTerminalState(record, collectionTerminalState); } else {