Class BulkUpdate

java.lang.Object
me.lucko.luckperms.common.bulkupdate.BulkUpdate

public final class BulkUpdate extends Object
Represents a query to be applied to a set of data. Queries can either be applied to im-memory sets of data, or converted to SQL syntax to be executed remotely.
  • Constructor Details

    • BulkUpdate

      public BulkUpdate(DataType dataType, Action action, List<Query> queries, boolean trackStatistics)
  • Method Details

    • satisfiesConstraints

      public boolean satisfiesConstraints(net.luckperms.api.node.Node node)
      Check to see if a Node instance satisfies the constrints of this query
      Parameters:
      node - the node to check
      Returns:
      true if satisfied
    • apply

      public @Nullable Set<net.luckperms.api.node.Node> apply(Set<net.luckperms.api.node.Node> nodes, HolderType holderType)
      Applies this query to the given set of nodes, and returns the result.
      Parameters:
      nodes - the input nodes
      holderType - the holder type the nodes are from
      Returns:
      the transformed nodes, or null if no change was made
    • buildAsSql

      public PreparedStatementBuilder buildAsSql()
      Converts this BulkUpdate to SQL syntax
      Returns:
      this query in SQL form
    • appendConstraintsAsSql

      public PreparedStatementBuilder appendConstraintsAsSql(PreparedStatementBuilder builder)
      Appends the constraints of this BulkUpdate to the provided statement builder in SQL syntax
      Parameters:
      builder - the statement builder to append the constraints to
      Returns:
      the same statement builder provided as input
    • getDataType

      public DataType getDataType()
    • getAction

      public Action getAction()
    • getQueries

      public List<Query> getQueries()
    • isTrackingStatistics

      public boolean isTrackingStatistics()
    • getStatistics

      public BulkUpdateStatistics getStatistics()
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object