Search in sources :

Example 1 with DoubleType

use of org.bimserver.models.store.DoubleType in project BIMserver by opensourceBIM.

the class BimServer method cloneAndAdd.

public Type cloneAndAdd(DatabaseSession session, Type input) throws BimserverDatabaseException {
    if (input instanceof BooleanType) {
        BooleanType booleanType = session.create(BooleanType.class);
        booleanType.setValue(((BooleanType) input).isValue());
        session.store(booleanType);
        return booleanType;
    } else if (input instanceof StringType) {
        StringType stringType = session.create(StringType.class);
        stringType.setValue(((StringType) input).getValue());
        session.store(stringType);
        return stringType;
    } else if (input instanceof DoubleType) {
        DoubleType doubleType = session.create(DoubleType.class);
        doubleType.setValue(((DoubleType) input).getValue());
        session.store(doubleType);
        return doubleType;
    } else if (input instanceof LongType) {
        LongType longType = session.create(LongType.class);
        longType.setValue(((LongType) input).getValue());
        session.store(longType);
        return longType;
    }
    return null;
}
Also used : LongType(org.bimserver.models.store.LongType) StringType(org.bimserver.models.store.StringType) DoubleType(org.bimserver.models.store.DoubleType) BooleanType(org.bimserver.models.store.BooleanType)

Aggregations

BooleanType (org.bimserver.models.store.BooleanType)1 DoubleType (org.bimserver.models.store.DoubleType)1 LongType (org.bimserver.models.store.LongType)1 StringType (org.bimserver.models.store.StringType)1