All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.annot8.common.implementations.content.AbstractContent Maven / Gradle / Ivy

There is a newer version: 0.2.0
Show newest version
/* 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> 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> 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> 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