aboutsummaryrefslogtreecommitdiffstats
path: root/config-model/src/main/java/com/yahoo/documentmodel/OwnedTemporaryType.java
diff options
context:
space:
mode:
Diffstat (limited to 'config-model/src/main/java/com/yahoo/documentmodel/OwnedTemporaryType.java')
-rw-r--r--config-model/src/main/java/com/yahoo/documentmodel/OwnedTemporaryType.java41
1 files changed, 41 insertions, 0 deletions
diff --git a/config-model/src/main/java/com/yahoo/documentmodel/OwnedTemporaryType.java b/config-model/src/main/java/com/yahoo/documentmodel/OwnedTemporaryType.java
new file mode 100644
index 00000000000..536c10ee242
--- /dev/null
+++ b/config-model/src/main/java/com/yahoo/documentmodel/OwnedTemporaryType.java
@@ -0,0 +1,41 @@
+// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
+package com.yahoo.documentmodel;
+
+import com.yahoo.document.DocumentType;
+import com.yahoo.document.StructDataType;
+
+/**
+ * Proxy for a struct type declared in a specific document
+ *
+ * @author arnej
+ **/
+public final class OwnedTemporaryType extends StructDataType implements OwnedType {
+
+ private final String ownerName;
+ private final String uniqueName;
+
+ public OwnedTemporaryType(String name, DocumentType document) {
+ this(name, document.getName());
+ }
+
+ public OwnedTemporaryType(String name, String owner) {
+ super(name);
+ this.ownerName = owner;
+ this.uniqueName = name + "@" + owner;
+ }
+
+ @Override
+ public String getOwnerName() {
+ return ownerName;
+ }
+
+ @Override
+ public String getUniqueName() {
+ return uniqueName;
+ }
+
+ @Override
+ public String toString() {
+ return "{OwnedTemporaryType "+uniqueName+" id="+getId()+" uid="+getUniqueId()+"}";
+ }
+}