Record Class EntityFilter

java.lang.Object
java.lang.Record
de.eldoria.schematicsanitizer.sanitizer.filter.EntityFilter
Record Components:
removeCreature - remove entities which are classified as Creature
removeNonCreatures - remove entities which are not classified as Creature
entityBlacklist - remove entities which have the exact type

public record EntityFilter(boolean removeCreature, boolean removeNonCreatures, Set<com.sk89q.worldedit.world.entity.EntityType> entityBlacklist) extends Record
A filter for entities
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntityFilter(boolean removeCreature, boolean removeNonCreatures, Set<com.sk89q.worldedit.world.entity.EntityType> entityBlacklist)
    Creates an instance of a EntityFilter record class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Set<com.sk89q.worldedit.world.entity.EntityType>
    Returns the value of the entityBlacklist record component.
    final boolean
    Indicates whether some other object is "equal to" this one.
    final int
    Returns a hash code value for this object.
    boolean
    isBlacklisted(com.sk89q.worldedit.world.entity.EntityType entityType)
    Checks if the given entity type is blacklisted.
    boolean
    Returns the value of the removeCreature record component.
    boolean
    Returns the value of the removeNonCreatures record component.
    final String
    Returns a string representation of this record class.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • EntityFilter

      public EntityFilter(boolean removeCreature, boolean removeNonCreatures, Set<com.sk89q.worldedit.world.entity.EntityType> entityBlacklist)
      Creates an instance of a EntityFilter record class.
      Parameters:
      removeCreature - the value for the removeCreature record component
      removeNonCreatures - the value for the removeNonCreatures record component
      entityBlacklist - the value for the entityBlacklist record component
  • Method Details

    • isBlacklisted

      public boolean isBlacklisted(com.sk89q.worldedit.world.entity.EntityType entityType)
      Checks if the given entity type is blacklisted.
      Parameters:
      entityType - the entity type to be checked
      Returns:
      true if the entity type is blacklisted, false otherwise
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • removeCreature

      public boolean removeCreature()
      Returns the value of the removeCreature record component.
      Returns:
      the value of the removeCreature record component
    • removeNonCreatures

      public boolean removeNonCreatures()
      Returns the value of the removeNonCreatures record component.
      Returns:
      the value of the removeNonCreatures record component
    • entityBlacklist

      public Set<com.sk89q.worldedit.world.entity.EntityType> entityBlacklist()
      Returns the value of the entityBlacklist record component.
      Returns:
      the value of the entityBlacklist record component