io.annot8.common.implementations.content.AbstractContent Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of annot8-common-implementations Show documentation
Show all versions of annot8-common-implementations Show documentation
Common functionality used by Annot8 implementations
/* Annot8 (annot8.io) - Licensed under Apache-2.0. */
package io.annot8.common.implementations.content;
import java.util.function.Supplier;
import io.annot8.core.data.Content;
import io.annot8.core.properties.ImmutableProperties;
import io.annot8.core.stores.AnnotationStore;
public abstract class AbstractContent implements Content {
private final Class dataClass;
private final Class extends Content> contentClass;
private final String id;
private final String name;
private final AnnotationStore annotations;
private final ImmutableProperties properties;
private final Supplier data;
protected AbstractContent(
Class dataClass,
Class extends Content> contentClass,
AnnotationStore annotations,
String id,
String name,
ImmutableProperties properties,
Supplier data) {
this.dataClass = dataClass;
this.contentClass = contentClass;
this.annotations = annotations;
this.id = id;
this.name = name;
this.properties = properties;
this.data = data;
}
@Override
public String getId() {
return id;
}
@Override
public D getData() {
return data.get();
}
@Override
public Class getDataClass() {
return dataClass;
}
@Override
public Class extends Content> getContentClass() {
return contentClass;
}
@Override
public AnnotationStore getAnnotations() {
return annotations;
}
@Override
public String getName() {
return name;
}
@Override
public ImmutableProperties getProperties() {
return properties;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy