@Override public NavigableSetConverter<?, ?> getConverter(JTransaction jtx) { final Converter<?, ?> elementConverter = this.elementField.getConverter(jtx); return elementConverter != null ? this.createConverter(elementConverter) : null; }
@Override @SuppressWarnings("rawtypes") public Property<?> caseJSetField(JSetField jfield) { return new CollectionProperty(jfield.getValue(jobj)); } @Override
/** * Read a set field. This returns the set returned by {@link Transaction#readSetField Transaction.readSetField()} with * {@link ObjId}s converted into {@link JObject}s, etc. * * <p> * This method is used by generated {@link io.permazen.annotation.JSetField @JSetField} * getter override methods and not normally invoked directly by user code. * * @param id ID of the object containing the field * @param storageId storage ID of the {@link JSetField} * @param updateVersion true to first automatically update the object's schema version, false to not change it * @return the set field in the object with storage ID {@code storageId} * @throws StaleTransactionException if this transaction is no longer usable * @throws DeletedObjectException if the object does not exist in this transaction * @throws UnknownFieldException if no {@link JSetField} corresponding to {@code storageId} exists * @throws TypeNotInSchemaVersionException if {@code updateVersion} is true but the object has a type * that does not exist in this instance's schema version * @throws NullPointerException if {@code id} is null */ public NavigableSet<?> readSetField(ObjId id, int storageId, boolean updateVersion) { return this.convert(this.jdb.getJField(id, storageId, JSetField.class).getConverter(this), this.tx.readSetField(id, storageId, updateVersion)); }
final JSetField jfield = new JSetField(this.jdb, fieldName, storageId, annotation, elementField, "set field `" + fieldName + "' in object type `" + this.name + "'", getter); elementField.parent = jfield;