Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
org.bimserver.interfaces.SConverter Maven / Gradle / Ivy
package org.bimserver.interfaces;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import org.bimserver.BimserverDatabaseException;
import org.bimserver.database.DatabaseSession;
import org.bimserver.database.OldQuery;
/******************************************************************************
* Copyright (C) 2009-2015 BIMserver.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see .
*****************************************************************************/
import org.bimserver.emf.IdEObjectImpl;
import org.bimserver.interfaces.objects.*;
import org.bimserver.models.geometry.GeometryData;
import org.bimserver.models.geometry.GeometryFactory;
import org.bimserver.models.geometry.GeometryInfo;
import org.bimserver.models.geometry.GeometryPackage;
import org.bimserver.models.geometry.Vector3f;
import org.bimserver.models.log.AccessMethod;
import org.bimserver.models.log.CheckoutRelated;
import org.bimserver.models.log.DatabaseCreated;
import org.bimserver.models.log.Download;
import org.bimserver.models.log.ExtendedDataAddedToProject;
import org.bimserver.models.log.ExtendedDataAddedToRevision;
import org.bimserver.models.log.GeoTagUpdated;
import org.bimserver.models.log.LogAction;
import org.bimserver.models.log.LogFactory;
import org.bimserver.models.log.LogPackage;
import org.bimserver.models.log.NewCheckoutAdded;
import org.bimserver.models.log.NewObjectIDMUploaded;
import org.bimserver.models.log.NewProjectAdded;
import org.bimserver.models.log.NewRevisionAdded;
import org.bimserver.models.log.NewUserAdded;
import org.bimserver.models.log.PasswordChanged;
import org.bimserver.models.log.PasswordReset;
import org.bimserver.models.log.ProjectDeleted;
import org.bimserver.models.log.ProjectRelated;
import org.bimserver.models.log.ProjectUndeleted;
import org.bimserver.models.log.ProjectUpdated;
import org.bimserver.models.log.RemoteServiceCalled;
import org.bimserver.models.log.RevisionBranched;
import org.bimserver.models.log.RevisionRelated;
import org.bimserver.models.log.RevisionUpdated;
import org.bimserver.models.log.ServerLog;
import org.bimserver.models.log.ServerStarted;
import org.bimserver.models.log.SettingsSaved;
import org.bimserver.models.log.UserAddedToProject;
import org.bimserver.models.log.UserChanged;
import org.bimserver.models.log.UserDeleted;
import org.bimserver.models.log.UserRelated;
import org.bimserver.models.log.UserRemovedFromProject;
import org.bimserver.models.log.UserUndeleted;
import org.bimserver.models.store.*;
public class SConverter {
public Set convertToSSetGeometryInfo(Collection input) {
Set result = new HashSet();
for (GeometryInfo o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetGeometryInfo(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SGeometryInfo o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListGeometryInfo(Collection input) {
List result = new ArrayList();
for (GeometryInfo o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListGeometryInfo(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SGeometryInfo o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SGeometryInfo convertToSObject(GeometryInfo input) {
if (input == null) {
return null;
}
SGeometryInfo result = new SGeometryInfo();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setStartVertex(input.getStartVertex());
result.setStartIndex(input.getStartIndex());
result.setPrimitiveCount(input.getPrimitiveCount());
result.setTransformation(input.getTransformation());
result.setArea(input.getArea());
result.setVolume(input.getVolume());
Vector3f minBoundsVal = input.getMinBounds();
result.setMinBounds(convertToSObject(minBoundsVal));
Vector3f maxBoundsVal = input.getMaxBounds();
result.setMaxBounds(convertToSObject(maxBoundsVal));
GeometryData dataVal = input.getData();
result.setDataId(dataVal == null ? -1 : dataVal.getOid());
return result;
}
public GeometryInfo convertFromSObject(SGeometryInfo input, DatabaseSession session) throws BimserverDatabaseException {
GeometryInfo result = convertFromSObject(input, GeometryFactory.eINSTANCE.createGeometryInfo(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public GeometryInfo convertFromSObject(SGeometryInfo input, GeometryInfo result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
result.setStartVertex(input.getStartVertex());
result.setStartIndex(input.getStartIndex());
result.setPrimitiveCount(input.getPrimitiveCount());
result.setTransformation(input.getTransformation());
result.setArea(input.getArea());
result.setVolume(input.getVolume());
result.setMinBounds(convertFromSObject(input.getMinBounds(), session));
result.setMaxBounds(convertFromSObject(input.getMaxBounds(), session));
result.setData((GeometryData)session.get(GeometryPackage.eINSTANCE.getGeometryData(), input.getDataId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetVector3f(Collection input) {
Set result = new HashSet();
for (Vector3f o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetVector3f(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SVector3f o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListVector3f(Collection input) {
List result = new ArrayList();
for (Vector3f o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListVector3f(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SVector3f o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SVector3f convertToSObject(Vector3f input) {
if (input == null) {
return null;
}
SVector3f result = new SVector3f();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setX(input.getX());
result.setY(input.getY());
result.setZ(input.getZ());
return result;
}
public Vector3f convertFromSObject(SVector3f input, DatabaseSession session) throws BimserverDatabaseException {
Vector3f result = convertFromSObject(input, GeometryFactory.eINSTANCE.createVector3f(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public Vector3f convertFromSObject(SVector3f input, Vector3f result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
result.setX(input.getX());
result.setY(input.getY());
result.setZ(input.getZ());
return result;
}
public Set convertToSSetGeometryData(Collection input) {
Set result = new HashSet();
for (GeometryData o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetGeometryData(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SGeometryData o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListGeometryData(Collection input) {
List result = new ArrayList();
for (GeometryData o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListGeometryData(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SGeometryData o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SGeometryData convertToSObject(GeometryData input) {
if (input == null) {
return null;
}
SGeometryData result = new SGeometryData();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setIndices(input.getIndices());
result.setVertices(input.getVertices());
result.setNormals(input.getNormals());
result.setMaterials(input.getMaterials());
result.setMaterialIndices(input.getMaterialIndices());
return result;
}
public GeometryData convertFromSObject(SGeometryData input, DatabaseSession session) throws BimserverDatabaseException {
GeometryData result = convertFromSObject(input, GeometryFactory.eINSTANCE.createGeometryData(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public GeometryData convertFromSObject(SGeometryData input, GeometryData result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
result.setIndices(input.getIndices());
result.setVertices(input.getVertices());
result.setNormals(input.getNormals());
result.setMaterials(input.getMaterials());
result.setMaterialIndices(input.getMaterialIndices());
return result;
}
public SAccessMethod convertToSObject(AccessMethod input) {
return SAccessMethod.values()[input.ordinal()];
}
public AccessMethod convertFromSObject(SAccessMethod input) {
return AccessMethod.values()[input.ordinal()];
}
public Set convertToSSetLogAction(Collection input) {
Set result = new HashSet();
for (LogAction o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetLogAction(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SLogAction o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListLogAction(Collection input) {
List result = new ArrayList();
for (LogAction o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListLogAction(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SLogAction o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SLogAction convertToSObject(LogAction input) {
if (input == null) {
return null;
}
if (input instanceof ExtendedDataAddedToProject) {
return convertToSObject((ExtendedDataAddedToProject)input);
}
else if (input instanceof ServerStarted) {
return convertToSObject((ServerStarted)input);
}
else if (input instanceof ExtendedDataAddedToRevision) {
return convertToSObject((ExtendedDataAddedToRevision)input);
}
else if (input instanceof ProjectRelated) {
return convertToSObject((ProjectRelated)input);
}
else if (input instanceof CheckoutRelated) {
return convertToSObject((CheckoutRelated)input);
}
else if (input instanceof NewObjectIDMUploaded) {
return convertToSObject((NewObjectIDMUploaded)input);
}
else if (input instanceof RevisionRelated) {
return convertToSObject((RevisionRelated)input);
}
else if (input instanceof DatabaseCreated) {
return convertToSObject((DatabaseCreated)input);
}
else if (input instanceof RevisionBranched) {
return convertToSObject((RevisionBranched)input);
}
else if (input instanceof GeoTagUpdated) {
return convertToSObject((GeoTagUpdated)input);
}
else if (input instanceof RemoteServiceCalled) {
return convertToSObject((RemoteServiceCalled)input);
}
else if (input instanceof UserRelated) {
return convertToSObject((UserRelated)input);
}
else if (input instanceof SettingsSaved) {
return convertToSObject((SettingsSaved)input);
}
else if (input instanceof Download) {
return convertToSObject((Download)input);
}
SLogAction result = new SLogAction();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
return result;
}
public LogAction convertFromSObject(SLogAction input, DatabaseSession session) throws BimserverDatabaseException {
LogAction result = convertFromSObject(input, LogFactory.eINSTANCE.createLogAction(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public LogAction convertFromSObject(SLogAction input, LogAction result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
if (input instanceof SExtendedDataAddedToProject) {
return convertFromSObject((SExtendedDataAddedToProject)input, session);
}
else if (input instanceof SServerStarted) {
return convertFromSObject((SServerStarted)input, session);
}
else if (input instanceof SExtendedDataAddedToRevision) {
return convertFromSObject((SExtendedDataAddedToRevision)input, session);
}
else if (input instanceof SProjectRelated) {
return convertFromSObject((SProjectRelated)input, session);
}
else if (input instanceof SCheckoutRelated) {
return convertFromSObject((SCheckoutRelated)input, session);
}
else if (input instanceof SNewObjectIDMUploaded) {
return convertFromSObject((SNewObjectIDMUploaded)input, session);
}
else if (input instanceof SRevisionRelated) {
return convertFromSObject((SRevisionRelated)input, session);
}
else if (input instanceof SDatabaseCreated) {
return convertFromSObject((SDatabaseCreated)input, session);
}
else if (input instanceof SRevisionBranched) {
return convertFromSObject((SRevisionBranched)input, session);
}
else if (input instanceof SGeoTagUpdated) {
return convertFromSObject((SGeoTagUpdated)input, session);
}
else if (input instanceof SRemoteServiceCalled) {
return convertFromSObject((SRemoteServiceCalled)input, session);
}
else if (input instanceof SUserRelated) {
return convertFromSObject((SUserRelated)input, session);
}
else if (input instanceof SSettingsSaved) {
return convertFromSObject((SSettingsSaved)input, session);
}
else if (input instanceof SDownload) {
return convertFromSObject((SDownload)input, session);
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetServerLog(Collection input) {
Set result = new HashSet();
for (ServerLog o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetServerLog(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SServerLog o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListServerLog(Collection input) {
List result = new ArrayList();
for (ServerLog o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListServerLog(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SServerLog o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SServerLog convertToSObject(ServerLog input) {
if (input == null) {
return null;
}
SServerLog result = new SServerLog();
result.setOid(input.getOid());
result.setRid(input.getRid());
List listactions = new ArrayList();
for (LogAction v : input.getActions()) {
listactions.add(v.getOid());
}
result.setActions(listactions);
return result;
}
public ServerLog convertFromSObject(SServerLog input, DatabaseSession session) throws BimserverDatabaseException {
ServerLog result = convertFromSObject(input, LogFactory.eINSTANCE.createServerLog(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public ServerLog convertFromSObject(SServerLog input, ServerLog result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
List listactions = result.getActions();
for (long oid : input.getActions()) {
listactions.add((LogAction)session.get(LogPackage.eINSTANCE.getLogAction(), oid, OldQuery.getDefault()));
}
return result;
}
public Set convertToSSetProjectRelated(Collection input) {
Set result = new HashSet();
for (ProjectRelated o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetProjectRelated(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SProjectRelated o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListProjectRelated(Collection input) {
List result = new ArrayList();
for (ProjectRelated o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListProjectRelated(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SProjectRelated o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SProjectRelated convertToSObject(ProjectRelated input) {
if (input == null) {
return null;
}
if (input instanceof ProjectDeleted) {
return convertToSObject((ProjectDeleted)input);
}
else if (input instanceof ProjectUndeleted) {
return convertToSObject((ProjectUndeleted)input);
}
else if (input instanceof ProjectUpdated) {
return convertToSObject((ProjectUpdated)input);
}
else if (input instanceof NewProjectAdded) {
return convertToSObject((NewProjectAdded)input);
}
SProjectRelated result = new SProjectRelated();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
Project projectVal = input.getProject();
result.setProjectId(projectVal == null ? -1 : projectVal.getOid());
return result;
}
public ProjectRelated convertFromSObject(SProjectRelated input, DatabaseSession session) throws BimserverDatabaseException {
ProjectRelated result = convertFromSObject(input, LogFactory.eINSTANCE.createProjectRelated(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public ProjectRelated convertFromSObject(SProjectRelated input, ProjectRelated result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
if (input instanceof SProjectDeleted) {
return convertFromSObject((SProjectDeleted)input, session);
}
else if (input instanceof SProjectUndeleted) {
return convertFromSObject((SProjectUndeleted)input, session);
}
else if (input instanceof SProjectUpdated) {
return convertFromSObject((SProjectUpdated)input, session);
}
else if (input instanceof SNewProjectAdded) {
return convertFromSObject((SNewProjectAdded)input, session);
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
result.setProject((Project)session.get(StorePackage.eINSTANCE.getProject(), input.getProjectId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetCheckoutRelated(Collection input) {
Set result = new HashSet();
for (CheckoutRelated o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetCheckoutRelated(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SCheckoutRelated o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListCheckoutRelated(Collection input) {
List result = new ArrayList();
for (CheckoutRelated o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListCheckoutRelated(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SCheckoutRelated o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SCheckoutRelated convertToSObject(CheckoutRelated input) {
if (input == null) {
return null;
}
if (input instanceof NewCheckoutAdded) {
return convertToSObject((NewCheckoutAdded)input);
}
SCheckoutRelated result = new SCheckoutRelated();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
Checkout checkoutVal = input.getCheckout();
result.setCheckoutId(checkoutVal == null ? -1 : checkoutVal.getOid());
return result;
}
public CheckoutRelated convertFromSObject(SCheckoutRelated input, DatabaseSession session) throws BimserverDatabaseException {
CheckoutRelated result = convertFromSObject(input, LogFactory.eINSTANCE.createCheckoutRelated(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public CheckoutRelated convertFromSObject(SCheckoutRelated input, CheckoutRelated result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
if (input instanceof SNewCheckoutAdded) {
return convertFromSObject((SNewCheckoutAdded)input, session);
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
result.setCheckout((Checkout)session.get(StorePackage.eINSTANCE.getCheckout(), input.getCheckoutId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetRevisionRelated(Collection input) {
Set result = new HashSet();
for (RevisionRelated o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetRevisionRelated(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SRevisionRelated o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListRevisionRelated(Collection input) {
List result = new ArrayList();
for (RevisionRelated o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListRevisionRelated(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SRevisionRelated o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SRevisionRelated convertToSObject(RevisionRelated input) {
if (input == null) {
return null;
}
if (input instanceof RevisionUpdated) {
return convertToSObject((RevisionUpdated)input);
}
else if (input instanceof NewRevisionAdded) {
return convertToSObject((NewRevisionAdded)input);
}
SRevisionRelated result = new SRevisionRelated();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
Revision revisionVal = input.getRevision();
result.setRevisionId(revisionVal == null ? -1 : revisionVal.getOid());
return result;
}
public RevisionRelated convertFromSObject(SRevisionRelated input, DatabaseSession session) throws BimserverDatabaseException {
RevisionRelated result = convertFromSObject(input, LogFactory.eINSTANCE.createRevisionRelated(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public RevisionRelated convertFromSObject(SRevisionRelated input, RevisionRelated result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
if (input instanceof SRevisionUpdated) {
return convertFromSObject((SRevisionUpdated)input, session);
}
else if (input instanceof SNewRevisionAdded) {
return convertFromSObject((SNewRevisionAdded)input, session);
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
result.setRevision((Revision)session.get(StorePackage.eINSTANCE.getRevision(), input.getRevisionId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetUserRelated(Collection input) {
Set result = new HashSet();
for (UserRelated o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetUserRelated(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SUserRelated o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListUserRelated(Collection input) {
List result = new ArrayList();
for (UserRelated o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListUserRelated(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SUserRelated o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SUserRelated convertToSObject(UserRelated input) {
if (input == null) {
return null;
}
if (input instanceof UserAddedToProject) {
return convertToSObject((UserAddedToProject)input);
}
else if (input instanceof UserDeleted) {
return convertToSObject((UserDeleted)input);
}
else if (input instanceof NewUserAdded) {
return convertToSObject((NewUserAdded)input);
}
else if (input instanceof PasswordChanged) {
return convertToSObject((PasswordChanged)input);
}
else if (input instanceof PasswordReset) {
return convertToSObject((PasswordReset)input);
}
else if (input instanceof UserChanged) {
return convertToSObject((UserChanged)input);
}
else if (input instanceof UserUndeleted) {
return convertToSObject((UserUndeleted)input);
}
else if (input instanceof UserRemovedFromProject) {
return convertToSObject((UserRemovedFromProject)input);
}
SUserRelated result = new SUserRelated();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
User userVal = input.getUser();
result.setUserId(userVal == null ? -1 : userVal.getOid());
return result;
}
public UserRelated convertFromSObject(SUserRelated input, DatabaseSession session) throws BimserverDatabaseException {
UserRelated result = convertFromSObject(input, LogFactory.eINSTANCE.createUserRelated(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public UserRelated convertFromSObject(SUserRelated input, UserRelated result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
if (input instanceof SUserAddedToProject) {
return convertFromSObject((SUserAddedToProject)input, session);
}
else if (input instanceof SUserDeleted) {
return convertFromSObject((SUserDeleted)input, session);
}
else if (input instanceof SNewUserAdded) {
return convertFromSObject((SNewUserAdded)input, session);
}
else if (input instanceof SPasswordChanged) {
return convertFromSObject((SPasswordChanged)input, session);
}
else if (input instanceof SPasswordReset) {
return convertFromSObject((SPasswordReset)input, session);
}
else if (input instanceof SUserChanged) {
return convertFromSObject((SUserChanged)input, session);
}
else if (input instanceof SUserUndeleted) {
return convertFromSObject((SUserUndeleted)input, session);
}
else if (input instanceof SUserRemovedFromProject) {
return convertFromSObject((SUserRemovedFromProject)input, session);
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
result.setUser((User)session.get(StorePackage.eINSTANCE.getUser(), input.getUserId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetNewUserAdded(Collection input) {
Set result = new HashSet();
for (NewUserAdded o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetNewUserAdded(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SNewUserAdded o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListNewUserAdded(Collection input) {
List result = new ArrayList();
for (NewUserAdded o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListNewUserAdded(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SNewUserAdded o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SNewUserAdded convertToSObject(NewUserAdded input) {
if (input == null) {
return null;
}
SNewUserAdded result = new SNewUserAdded();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
User userVal = input.getUser();
result.setUserId(userVal == null ? -1 : userVal.getOid());
return result;
}
public NewUserAdded convertFromSObject(SNewUserAdded input, DatabaseSession session) throws BimserverDatabaseException {
NewUserAdded result = convertFromSObject(input, LogFactory.eINSTANCE.createNewUserAdded(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public NewUserAdded convertFromSObject(SNewUserAdded input, NewUserAdded result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
result.setUser((User)session.get(StorePackage.eINSTANCE.getUser(), input.getUserId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetNewProjectAdded(Collection input) {
Set result = new HashSet();
for (NewProjectAdded o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetNewProjectAdded(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SNewProjectAdded o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListNewProjectAdded(Collection input) {
List result = new ArrayList();
for (NewProjectAdded o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListNewProjectAdded(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SNewProjectAdded o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SNewProjectAdded convertToSObject(NewProjectAdded input) {
if (input == null) {
return null;
}
SNewProjectAdded result = new SNewProjectAdded();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
Project projectVal = input.getProject();
result.setProjectId(projectVal == null ? -1 : projectVal.getOid());
Project parentProjectVal = input.getParentProject();
result.setParentProjectId(parentProjectVal == null ? -1 : parentProjectVal.getOid());
return result;
}
public NewProjectAdded convertFromSObject(SNewProjectAdded input, DatabaseSession session) throws BimserverDatabaseException {
NewProjectAdded result = convertFromSObject(input, LogFactory.eINSTANCE.createNewProjectAdded(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public NewProjectAdded convertFromSObject(SNewProjectAdded input, NewProjectAdded result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
result.setProject((Project)session.get(StorePackage.eINSTANCE.getProject(), input.getProjectId(), OldQuery.getDefault()));
result.setParentProject((Project)session.get(StorePackage.eINSTANCE.getProject(), input.getParentProjectId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetRevisionBranched(Collection input) {
Set result = new HashSet();
for (RevisionBranched o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetRevisionBranched(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SRevisionBranched o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListRevisionBranched(Collection input) {
List result = new ArrayList();
for (RevisionBranched o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListRevisionBranched(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SRevisionBranched o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SRevisionBranched convertToSObject(RevisionBranched input) {
if (input == null) {
return null;
}
SRevisionBranched result = new SRevisionBranched();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
Revision oldrevisionVal = input.getOldrevision();
result.setOldrevisionId(oldrevisionVal == null ? -1 : oldrevisionVal.getOid());
Revision newrevisionVal = input.getNewrevision();
result.setNewrevisionId(newrevisionVal == null ? -1 : newrevisionVal.getOid());
return result;
}
public RevisionBranched convertFromSObject(SRevisionBranched input, DatabaseSession session) throws BimserverDatabaseException {
RevisionBranched result = convertFromSObject(input, LogFactory.eINSTANCE.createRevisionBranched(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public RevisionBranched convertFromSObject(SRevisionBranched input, RevisionBranched result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
result.setOldrevision((Revision)session.get(StorePackage.eINSTANCE.getRevision(), input.getOldrevisionId(), OldQuery.getDefault()));
result.setNewrevision((Revision)session.get(StorePackage.eINSTANCE.getRevision(), input.getNewrevisionId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetNewRevisionAdded(Collection input) {
Set result = new HashSet();
for (NewRevisionAdded o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetNewRevisionAdded(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SNewRevisionAdded o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListNewRevisionAdded(Collection input) {
List result = new ArrayList();
for (NewRevisionAdded o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListNewRevisionAdded(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SNewRevisionAdded o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SNewRevisionAdded convertToSObject(NewRevisionAdded input) {
if (input == null) {
return null;
}
SNewRevisionAdded result = new SNewRevisionAdded();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
Revision revisionVal = input.getRevision();
result.setRevisionId(revisionVal == null ? -1 : revisionVal.getOid());
Project projectVal = input.getProject();
result.setProjectId(projectVal == null ? -1 : projectVal.getOid());
return result;
}
public NewRevisionAdded convertFromSObject(SNewRevisionAdded input, DatabaseSession session) throws BimserverDatabaseException {
NewRevisionAdded result = convertFromSObject(input, LogFactory.eINSTANCE.createNewRevisionAdded(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public NewRevisionAdded convertFromSObject(SNewRevisionAdded input, NewRevisionAdded result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
result.setRevision((Revision)session.get(StorePackage.eINSTANCE.getRevision(), input.getRevisionId(), OldQuery.getDefault()));
result.setProject((Project)session.get(StorePackage.eINSTANCE.getProject(), input.getProjectId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetNewCheckoutAdded(Collection input) {
Set result = new HashSet();
for (NewCheckoutAdded o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetNewCheckoutAdded(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SNewCheckoutAdded o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListNewCheckoutAdded(Collection input) {
List result = new ArrayList();
for (NewCheckoutAdded o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListNewCheckoutAdded(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SNewCheckoutAdded o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SNewCheckoutAdded convertToSObject(NewCheckoutAdded input) {
if (input == null) {
return null;
}
SNewCheckoutAdded result = new SNewCheckoutAdded();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
Checkout checkoutVal = input.getCheckout();
result.setCheckoutId(checkoutVal == null ? -1 : checkoutVal.getOid());
return result;
}
public NewCheckoutAdded convertFromSObject(SNewCheckoutAdded input, DatabaseSession session) throws BimserverDatabaseException {
NewCheckoutAdded result = convertFromSObject(input, LogFactory.eINSTANCE.createNewCheckoutAdded(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public NewCheckoutAdded convertFromSObject(SNewCheckoutAdded input, NewCheckoutAdded result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
result.setCheckout((Checkout)session.get(StorePackage.eINSTANCE.getCheckout(), input.getCheckoutId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetSettingsSaved(Collection input) {
Set result = new HashSet();
for (SettingsSaved o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetSettingsSaved(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet();
for (SSettingsSaved o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public List convertToSListSettingsSaved(Collection input) {
List result = new ArrayList();
for (SettingsSaved o : input) {
result.add(convertToSObject(o));
}
return result;
}
public List convertFromSListSettingsSaved(Collection input, DatabaseSession session) throws BimserverDatabaseException {
List result = new ArrayList();
for (SSettingsSaved o : input) {
result.add(convertFromSObject(o, session));
}
return result;
}
public SSettingsSaved convertToSObject(SettingsSaved input) {
if (input == null) {
return null;
}
SSettingsSaved result = new SSettingsSaved();
result.setOid(input.getOid());
result.setRid(input.getRid());
result.setDate(input.getDate());
result.setAccessMethod(SAccessMethod.values()[input.getAccessMethod().ordinal()]);
User executorVal = input.getExecutor();
result.setExecutorId(executorVal == null ? -1 : executorVal.getOid());
return result;
}
public SettingsSaved convertFromSObject(SSettingsSaved input, DatabaseSession session) throws BimserverDatabaseException {
SettingsSaved result = convertFromSObject(input, LogFactory.eINSTANCE.createSettingsSaved(), session);
((IdEObjectImpl)result).setOid(input.getOid());
((IdEObjectImpl)result).setRid(input.getRid());
return result;
}
public SettingsSaved convertFromSObject(SSettingsSaved input, SettingsSaved result, DatabaseSession session) throws BimserverDatabaseException {
if (input == null) {
return null;
}
result.setDate(input.getDate());
result.setAccessMethod(AccessMethod.values()[input.getAccessMethod().ordinal()]);
result.setExecutor((User)session.get(StorePackage.eINSTANCE.getUser(), input.getExecutorId(), OldQuery.getDefault()));
return result;
}
public Set convertToSSetUserAddedToProject(Collection input) {
Set result = new HashSet();
for (UserAddedToProject o : input) {
result.add(convertToSObject(o));
}
return result;
}
public Set convertFromSSetUserAddedToProject(Collection input, DatabaseSession session) throws BimserverDatabaseException {
Set result = new HashSet