Record Class EntityFilter
java.lang.Object
java.lang.Record
de.eldoria.schematicsanitizer.sanitizer.filter.EntityFilter
- Record Components:
removeCreature
- remove entities which are classified asCreature
removeNonCreatures
- remove entities which are not classified asCreature
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
ConstructorsConstructorDescriptionEntityFilter
(boolean removeCreature, boolean removeNonCreatures, Set<com.sk89q.worldedit.world.entity.EntityType> entityBlacklist) Creates an instance of aEntityFilter
record class. -
Method Summary
Modifier and TypeMethodDescriptionSet
<com.sk89q.worldedit.world.entity.EntityType> Returns the value of theentityBlacklist
record component.final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
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 theremoveCreature
record component.boolean
Returns the value of theremoveNonCreatures
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
EntityFilter
public EntityFilter(boolean removeCreature, boolean removeNonCreatures, Set<com.sk89q.worldedit.world.entity.EntityType> entityBlacklist) Creates an instance of aEntityFilter
record class.- Parameters:
removeCreature
- the value for theremoveCreature
record componentremoveNonCreatures
- the value for theremoveNonCreatures
record componententityBlacklist
- the value for theentityBlacklist
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
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. -
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. -
equals
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 withObjects::equals(Object,Object)
; primitive components are compared with '=='. -
removeCreature
public boolean removeCreature()Returns the value of theremoveCreature
record component.- Returns:
- the value of the
removeCreature
record component
-
removeNonCreatures
public boolean removeNonCreatures()Returns the value of theremoveNonCreatures
record component.- Returns:
- the value of the
removeNonCreatures
record component
-
entityBlacklist
Returns the value of theentityBlacklist
record component.- Returns:
- the value of the
entityBlacklist
record component
-