Class AnnotateOneRowOperation

  • All Implemented Interfaces:
    Operation

    public class AnnotateOneRowOperation
    extends Object
    implements Operation
    An operation which updates the flag or star field of a single row in the project.
    • Field Detail

      • rowId

        protected final long rowId
      • star

        protected final boolean star
      • value

        protected final boolean value
    • Constructor Detail

      • AnnotateOneRowOperation

        public AnnotateOneRowOperation​(long rowId,
                                       boolean star,
                                       boolean value)
    • Method Detail

      • apply

        public ChangeResult apply​(Grid projectState,
                                  ChangeContext context)
                           throws OperationException
        Description copied from interface: Operation
        Derives the new grid state from the current grid state. Executing this method should be quick (even on large datasets) since it is expected to just derive the new grid from the existing one without actually executing any expensive computation. Long-running computations should rather go in the derivation of a ChangeData which will be fetched asynchronously.
        Specified by:
        apply in interface Operation
        Parameters:
        projectState - the state of the grid before the change
        Returns:
        an object which bundles up various pieces of information produced by the operation: primarily, the new grid after applying the operation. This object can be subclassed to expose more information, which should be serializable with Jackson so that it reaches the frontend.
        Throws:
        OperationException - when the change cannot be applied to the given grid
      • getDescription

        public String getDescription()
        Description copied from interface: Operation
        A short human-readable description of what this operation does.
        Specified by:
        getDescription in interface Operation
      • isReproducible

        public boolean isReproducible()
        Description copied from interface: Operation
        Could this operation be meaningfully re-applied to another project, or is it too specific to the data in this project? Operations which affect a single row or cell designated by a row index should return false, indicating that they are small fixes that should likely not be part of a reusable pipeline.
        Specified by:
        isReproducible in interface Operation
      • mapper

        protected static RowMapper mapper​(long rowId,
                                          boolean star,
                                          boolean value)