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.DependencySide
The field for theapplicableSides
record component.private final boolean
The field for thevalue
record component. -
Constructor Summary
ConstructorsConstructorDescriptionBooleanFeatureTest
(IModInfo.DependencySide applicableSides, boolean value) Creates an instance of aBooleanFeatureTest
record class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theapplicableSides
record component.convertFromString
(String value) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.boolean
final String
toString()
Returns a string representation of this record class.boolean
value()
Returns the value of thevalue
record component.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.neoforged.neoforgespi.locating.ForgeFeature.IFeatureTest
testSideWithString
-
Field Details
-
applicableSides
The field for theapplicableSides
record component. -
value
private final boolean valueThe field for thevalue
record component.
-
-
Constructor Details
-
BooleanFeatureTest
Creates an instance of aBooleanFeatureTest
record class.- Parameters:
applicableSides
- the value for theapplicableSides
record componentvalue
- the value for thevalue
record component
-
-
Method Details
-
test
-
featureValue
- Specified by:
featureValue
in interfaceForgeFeature.IFeatureTest<Boolean>
-
convertFromString
- Specified by:
convertFromString
in 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 theapplicableSides
record component.- Specified by:
applicableSides
in interfaceForgeFeature.IFeatureTest<Boolean>
- Returns:
- the value of the
applicableSides
record component
-
value
public boolean value()Returns the value of thevalue
record component.- Returns:
- the value of the
value
record component
-