From 02260cadde55aa53a8f93928381460defc0604de Mon Sep 17 00:00:00 2001 From: Timm Fitschen <t.fitschen@indiscale.com> Date: Tue, 30 Jun 2020 12:48:21 +0200 Subject: [PATCH] MAINT: removed unused ValidEntity.java --- .../caosdb/server/entity/ValidEntity.java | 68 ------------------- 1 file changed, 68 deletions(-) delete mode 100644 src/main/java/caosdb/server/entity/ValidEntity.java diff --git a/src/main/java/caosdb/server/entity/ValidEntity.java b/src/main/java/caosdb/server/entity/ValidEntity.java deleted file mode 100644 index 3e99d4ea..00000000 --- a/src/main/java/caosdb/server/entity/ValidEntity.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * ** header v3.0 - * This file is a part of the CaosDB Project. - * - * Copyright (C) 2018 Research Group Biomedical Physics, - * Max-Planck-Institute for Dynamics and Self-Organization Göttingen - * - * 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 <https://www.gnu.org/licenses/>. - * - * ** end header - */ -package caosdb.server.entity; - -import caosdb.server.database.proto.SparseEntity; -import caosdb.server.datatype.AbstractCollectionDatatype; - -public class ValidEntity extends Entity { - - public ValidEntity(final int id) { - super(id); - } - - public ValidEntity parseSparseEntity(final SparseEntity spe) { - setId(spe.id); - this.setRole(spe.role); - setEntityACL(spe.acl); - - if (!isNameOverride()) { - setName(spe.name); - } - if (!isDescOverride()) { - setDescription(spe.description); - } - if (!isDatatypeOverride()) { - final String dt = spe.datatype; - final String col = spe.collection; - - if (dt != null - && !dt.equalsIgnoreCase("null") - && (!hasDatatype() || !dt.equalsIgnoreCase(getDatatype().toString()))) { - if (col != null && !col.equalsIgnoreCase("null")) { - this.setDatatype(AbstractCollectionDatatype.collectionDatatypeFactory(col, dt)); - } else { - this.setDatatype(dt); - } - } - } - - if (spe.filePath != null) { - setFileProperties(new FileProperties(spe.fileHash, spe.filePath, spe.fileSize)); - } else { - setFileProperties(null); - } - - return this; - } -} -- GitLab