Record Class UnifiedCodecs.Conditional<P,V>
java.lang.Object
java.lang.Record
net.rebel459.unified.api.codec.UnifiedCodecs.Conditional<P,V>
- Enclosing class:
UnifiedCodecs
public static record UnifiedCodecs.Conditional<P,V> (ExtensibleCodecBase.Entry<P> predicate, ExtensibleCodecBase.Entry<V> ifTrue, ExtensibleCodecBase.Entry<V> ifFalse)
extends Record
-
Constructor Summary
ConstructorsConstructorDescriptionConditional(ExtensibleCodecBase.Entry<P> predicate, ExtensibleCodecBase.Entry<V> ifTrue, ExtensibleCodecBase.Entry<V> ifFalse) Creates an instance of aConditionalrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.ifFalse()Returns the value of theifFalserecord component.ifTrue()Returns the value of theifTruerecord component.Returns the value of thepredicaterecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Conditional
public Conditional(ExtensibleCodecBase.Entry<P> predicate, ExtensibleCodecBase.Entry<V> ifTrue, ExtensibleCodecBase.Entry<V> ifFalse) Creates an instance of aConditionalrecord class.- Parameters:
predicate- the value for thepredicaterecord componentifTrue- the value for theifTruerecord componentifFalse- the value for theifFalserecord component
-
-
Method Details
-
toString
-
hashCode
-
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). -
predicate
Returns the value of thepredicaterecord component.- Returns:
- the value of the
predicaterecord component
-
ifTrue
Returns the value of theifTruerecord component.- Returns:
- the value of the
ifTruerecord component
-
ifFalse
Returns the value of theifFalserecord component.- Returns:
- the value of the
ifFalserecord component
-