Record Class ForgeFeature.BooleanFeatureTest
java.lang.Object
java.lang.Record
net.neoforged.neoforgespi.locating.ForgeFeature.BooleanFeatureTest
- All Implemented Interfaces:
Predicate<Boolean>,ForgeFeature.IFeatureTest<Boolean>
- Enclosing class:
ForgeFeature
public static record ForgeFeature.BooleanFeatureTest(IModInfo.DependencySide applicableSides, boolean value)
extends Record
implements ForgeFeature.IFeatureTest<Boolean>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IModInfo.DependencySideThe field for theapplicableSidesrecord component.private final booleanThe field for thevaluerecord component. -
Constructor Summary
ConstructorsConstructorDescriptionBooleanFeatureTest(IModInfo.DependencySide applicableSides, boolean value) Creates an instance of aBooleanFeatureTestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theapplicableSidesrecord component.convertFromString(String value) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanfinal StringtoString()Returns a string representation of this record class.booleanvalue()Returns the value of thevaluerecord component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.neoforged.neoforgespi.locating.ForgeFeature.IFeatureTest
testSideWithString
-
Field Details
-
applicableSides
The field for theapplicableSidesrecord component. -
value
private final boolean valueThe field for thevaluerecord component.
-
-
Constructor Details
-
BooleanFeatureTest
Creates an instance of aBooleanFeatureTestrecord class.- Parameters:
applicableSides- the value for theapplicableSidesrecord componentvalue- the value for thevaluerecord component
-
-
Method Details
-
test
-
featureValue
- Specified by:
featureValuein interfaceForgeFeature.IFeatureTest<Boolean>
-
convertFromString
- Specified by:
convertFromStringin interfaceForgeFeature.IFeatureTest<Boolean>
-
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 '=='. -
applicableSides
Returns the value of theapplicableSidesrecord component.- Specified by:
applicableSidesin interfaceForgeFeature.IFeatureTest<Boolean>- Returns:
- the value of the
applicableSidesrecord component
-
value
public boolean value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-