
org.jsimpledb.schema.CounterSchemaField Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jsimpledb-coreapi Show documentation
Show all versions of jsimpledb-coreapi Show documentation
JSimpleDB core API classes which provide objects, fields, indexes, queries, and schema management on top of a key/value store.
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package org.jsimpledb.schema;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
/**
* A counter field in a {@link SchemaObjectType}.
*/
public class CounterSchemaField extends SchemaField {
@Override
public R visit(SchemaFieldSwitch target) {
return target.caseCounterSchemaField(this);
}
@Override
void writeXML(XMLStreamWriter writer) throws XMLStreamException {
writer.writeEmptyElement(COUNTER_FIELD_TAG.getNamespaceURI(), COUNTER_FIELD_TAG.getLocalPart());
this.writeAttributes(writer);
}
@Override
boolean isCompatibleWithInternal(AbstractSchemaItem that) {
return true;
}
// Object
@Override
public String toString() {
return "counter " + super.toString();
}
// Cloneable
@Override
public CounterSchemaField clone() {
return (CounterSchemaField)super.clone();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy