Skip to content
Snippets Groups Projects
Verified Commit 8e333069 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

MAINT: Removed archaic print(...) methods from entity classes,

parent ef187df5
No related branches found
No related tags found
2 merge requests!44Release 0.6,!43Merge f-GRPC-main to dev
Pipeline #16079 canceled
caosdb-proto @ 533c8e73
Subproject commit 9fa41dce325d370eb8da60a77e921d4a0618f513
Subproject commit 533c8e7341d0659e3cc43d834793a7a965703f55
......@@ -550,79 +550,11 @@ public class Entity extends AbstractObservable implements EntityInterface {
getToElementStrategy().addToElement(this, element, strategy);
}
/**
* Print this entity to the standard outputs. Just for debugging.
*
* @throws CaosDBException
*/
@Override
public void print() {
print("");
}
@Override
public Integer getDomain() {
return 0;
}
@Override
public void print(final String indent) {
System.out.println(
indent
+ "+---| "
+ this.getClass().getSimpleName()
+ " |----------------------------------");
if (getDomain() != 0) {
System.out.println(indent + "| Domain: " + Integer.toString(getDomain()));
}
if (hasId()) {
System.out.println(indent + "| ID: " + Integer.toString(getId()));
}
if (hasCuid()) {
System.out.println(indent + "| Cuid: " + getCuid());
}
if (hasName()) {
System.out.println(indent + "| Name: " + getName());
}
if (hasDescription()) {
System.out.println(indent + "| Description: " + getDescription());
}
if (hasRole()) {
System.out.println(indent + "| Role: " + getRole());
}
if (hasStatementStatus()) {
System.out.println(indent + "| Statement: " + getStatementStatus().toString());
}
if (hasDatatype()) {
System.out.println(indent + "| Datatype: " + getDatatype().toString());
}
if (hasValue()) {
System.out.println(indent + "| Value: " + getValue().toString());
}
if (hasEntityStatus()) {
System.out.println(indent + "| Entity: " + getEntityStatus().toString());
}
if (hasFileProperties()) {
getFileProperties().print(indent);
}
System.out.println(indent + "+-----------------------------------");
for (final ToElementable m : getMessages()) {
if (m instanceof Message) {
((Message) m).print(indent + "| ");
}
}
for (final EntityInterface p : getParents()) {
// p.print(indent + "| ");
System.out.println(indent + "| Parent: " + p.getName());
}
for (final EntityInterface s : getProperties()) {
s.print(indent + "| ");
}
if (indent.equals("")) {
System.out.println(indent + "+------------------------------------");
}
}
/** Errors, Warnings and Info messages for this entity. */
private final Set<ToElementable> messages = new HashSet<>();
......
......@@ -112,10 +112,6 @@ public interface EntityInterface
public abstract boolean hasDatatype();
public abstract void print();
public abstract void print(String indent);
public abstract FileProperties getFileProperties();
public abstract void setFileProperties(FileProperties fileProperties);
......
......@@ -103,21 +103,6 @@ public class FileProperties {
this.tmpIdentifier = tmpIdentifier;
}
public void print(final String indent) {
if (hasChecksum()) {
System.out.println(indent + "| Checksum: " + this.checksum);
}
if (hasPath()) {
System.out.println(indent + "| Path: " + "/" + this.path);
}
if (hasSize()) {
System.out.println(indent + "| Size: " + Long.toString(this.size));
}
if (getFile() != null) {
System.out.println(indent + "| File: " + getFile().getAbsolutePath());
}
}
public FileProperties setFile(final File file) {
this.file = file;
return this;
......
......@@ -182,23 +182,6 @@ public class Message extends Exception implements Comparable<Message>, ToElement
parent.addContent(e);
}
/** Print this entity to the standard outputs. Just for debugging. */
public final void print() {
print("");
}
public final void print(final String indent) {
System.out.println(indent + "+---| " + this.type + " |------------------------ ");
System.out.println(indent + "| Code: " + this.code.toString());
System.out.println(indent + "| Description: " + this.description);
System.out.println(indent + "| Body: " + this.body);
System.out.println(indent + "+------------------------------------------------------ ");
}
public boolean equalsCore(final Message other) {
return this.code == other.code && this.description == other.description;
}
@Override
public int compareTo(final Message o) {
final int tc = this.type.compareToIgnoreCase(o.type);
......
......@@ -114,15 +114,6 @@ public class TransactionContainer extends Container<EntityInterface>
}
}
public void print() {
System.out.println("*******************************************************************");
System.out.println("*******************************************************************");
for (final EntityInterface e : this) {
e.print("*");
}
System.out.println("*******************************************************************\n\n");
}
/** The files that have been uploaded. */
private HashMap<String, FileProperties> files = new HashMap<String, FileProperties>();
......
......@@ -290,16 +290,6 @@ public class EntityWrapper implements EntityInterface {
this.entity.addToElement(element);
}
@Override
public void print() {
this.entity.print();
}
@Override
public void print(final String indent) {
this.entity.print(indent);
}
@Override
public FileProperties getFileProperties() {
return this.entity.getFileProperties();
......
......@@ -224,8 +224,6 @@ public class InsertTest {
subp.setStatementStatus(StatementStatus.FIX);
p2.addProperty(subp);
r.print();
final LinkedList<EntityInterface> stage1Inserts = new LinkedList<EntityInterface>();
final LinkedList<EntityInterface> stage2Inserts = new LinkedList<EntityInterface>();
......@@ -254,15 +252,6 @@ public class InsertTest {
assertEquals((Integer) 2, stage2Inserts.get(0).getId());
assertEquals("V2", ((SingleValue) stage2Inserts.get(0).getValue()).toDatabaseString());
assertFalse(stage2Inserts.get(0).hasReplacement());
System.out.println("######### stage 1 #########");
for (EntityInterface e : stage1Inserts) {
e.print();
}
System.out.println("######### stage 2 #########");
for (EntityInterface e : stage2Inserts) {
e.print();
}
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment