Record Class ForgeFeature.VersionFeatureTest
java.lang.Object
java.lang.Record
net.neoforged.neoforgespi.locating.ForgeFeature.VersionFeatureTest
- Record Components:
version- The version we wish to test against
- All Implemented Interfaces:
Predicate<org.apache.maven.artifact.versioning.VersionRange>,ForgeFeature.IFeatureTest<org.apache.maven.artifact.versioning.VersionRange>
- Enclosing class:
ForgeFeature
public static record ForgeFeature.VersionFeatureTest(IModInfo.DependencySide applicableSides, org.apache.maven.artifact.versioning.ArtifactVersion version)
extends Record
implements ForgeFeature.IFeatureTest<org.apache.maven.artifact.versioning.VersionRange>
Version based feature test. Uses standard MavenVersion system. Will test the constructed version against
ranges requested by mods.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final IModInfo.DependencySideThe field for theapplicableSidesrecord component.private final org.apache.maven.artifact.versioning.ArtifactVersionThe field for theversionrecord component. -
Constructor Summary
ConstructorsConstructorDescriptionVersionFeatureTest(IModInfo.DependencySide applicableSides, org.apache.maven.artifact.versioning.ArtifactVersion version) Creates an instance of aVersionFeatureTestrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theapplicableSidesrecord component.org.apache.maven.artifact.versioning.VersionRangeconvertFromString(String value) final booleanIndicates whether some other object is "equal to" this one.forVersionString(IModInfo.DependencySide side, String version) Convenience method for constructing the feature test for a version stringfinal inthashCode()Returns a hash code value for this object.booleantest(org.apache.maven.artifact.versioning.VersionRange versionRange) final StringtoString()Returns a string representation of this record class.org.apache.maven.artifact.versioning.ArtifactVersionversion()Returns the value of theversionrecord 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. -
version
private final org.apache.maven.artifact.versioning.ArtifactVersion versionThe field for theversionrecord component.
-
-
Constructor Details
-
VersionFeatureTest
public VersionFeatureTest(IModInfo.DependencySide applicableSides, org.apache.maven.artifact.versioning.ArtifactVersion version) Creates an instance of aVersionFeatureTestrecord class.- Parameters:
applicableSides- the value for theapplicableSidesrecord componentversion- the value for theversionrecord component
-
-
Method Details
-
forVersionString
public static ForgeFeature.VersionFeatureTest forVersionString(IModInfo.DependencySide side, String version) Convenience method for constructing the feature test for a version string- Parameters:
version- the string- Returns:
- the feature test for the supplied string
-
featureValue
- Specified by:
featureValuein interfaceForgeFeature.IFeatureTest<org.apache.maven.artifact.versioning.VersionRange>
-
test
public boolean test(org.apache.maven.artifact.versioning.VersionRange versionRange) -
convertFromString
- Specified by:
convertFromStringin interfaceForgeFeature.IFeatureTest<org.apache.maven.artifact.versioning.VersionRange>
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
applicableSides
Returns the value of theapplicableSidesrecord component.- Specified by:
applicableSidesin interfaceForgeFeature.IFeatureTest<org.apache.maven.artifact.versioning.VersionRange>- Returns:
- the value of the
applicableSidesrecord component
-
version
public org.apache.maven.artifact.versioning.ArtifactVersion version()Returns the value of theversionrecord component.- Returns:
- the value of the
versionrecord component
-