Record Class ConfigDependency<V>
java.lang.Object
java.lang.Record
net.ixdarklord.coolcatcore.api.config.ConfigDependency<V>
- Record Components:
source- the value depended oncondition- when the dependent value is active
public record ConfigDependency<V>(ConfigValue<V> source, Predicate<? super V> condition)
extends Record
A value that only matters while another value meets a condition, such as "particle count" while "particles" is on.
-
Constructor Summary
ConstructorsConstructorDescriptionConfigDependency(ConfigValue<V> source, Predicate<? super V> condition) Creates an instance of aConfigDependencyrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconditionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanisMet()Whether the condition holds for the source's current value.booleanWhether the condition holds for a value of the source that isn't current yet, like one pending in the config screen.source()Returns the value of thesourcerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
isMet
public boolean isMet()Whether the condition holds for the source's current value. -
isMetBy
Whether the condition holds for a value of the source that isn't current yet, like one pending in the config screen. -
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). -
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
condition
Returns the value of theconditionrecord component.- Returns:
- the value of the
conditionrecord component
-