![JAR search and dependency download from the Maven repository](/logo.png)
org.molgenis.data.index.Impact Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of molgenis-data-index Show documentation
Show all versions of molgenis-data-index Show documentation
Data layer indexing framework.
package org.molgenis.data.index;
import com.google.auto.value.AutoValue;
import javax.annotation.CheckForNull;
import javax.annotation.Nullable;
import org.molgenis.data.EntityKey;
/** Value object to store the impact of changes. */
@AutoValue
@SuppressWarnings("java:S1610") // Abstract classes without fields should be converted to interfaces
public abstract class Impact {
public abstract String getEntityTypeId();
@Nullable
@CheckForNull
public abstract Object getId();
public boolean isWholeRepository() {
return getId() == null;
}
public EntityKey toEntityKey() {
return EntityKey.create(getEntityTypeId(), getId());
}
public boolean isSingleEntity() {
return getId() != null;
}
public static Impact createSingleEntityImpact(String entityTypeId, Object id) {
return new AutoValue_Impact(entityTypeId, id);
}
public static Impact createWholeRepositoryImpact(String entityTypeId) {
return new AutoValue_Impact(entityTypeId, null);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy