Record Class UnionSpec
java.lang.Object
java.lang.Record
me.bristermitten.mittenlib.codegen.union.UnionSpec
- All Implemented Interfaces:
GenericTypeSpec
public record UnionSpec(com.squareup.javapoet.ClassName source, com.squareup.javapoet.ClassName name, MatchStrategies strategy, List<RecordConstructorSpec> constructors)
extends Record
implements GenericTypeSpec
-
Constructor Summary
ConstructorsConstructorDescriptionUnionSpec(com.squareup.javapoet.ClassName source, com.squareup.javapoet.ClassName name, MatchStrategies strategy, List<RecordConstructorSpec> constructors) Creates an instance of aUnionSpecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconstructorsrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.com.squareup.javapoet.ClassNamename()Returns the value of thenamerecord component.com.squareup.javapoet.ClassNamesource()Returns the value of thesourcerecord component.strategy()Returns the value of thestrategyrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UnionSpec
public UnionSpec(com.squareup.javapoet.ClassName source, com.squareup.javapoet.ClassName name, MatchStrategies strategy, List<RecordConstructorSpec> constructors) Creates an instance of aUnionSpecrecord class.- Parameters:
source- the value for thesourcerecord componentname- the value for thenamerecord componentstrategy- the value for thestrategyrecord componentconstructors- the value for theconstructorsrecord component
-
-
Method Details
-
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
public com.squareup.javapoet.ClassName source()Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
name
public com.squareup.javapoet.ClassName name()Returns the value of thenamerecord component.- Specified by:
namein interfaceGenericTypeSpec- Returns:
- the value of the
namerecord component
-
strategy
Returns the value of thestrategyrecord component.- Returns:
- the value of the
strategyrecord component
-
constructors
Returns the value of theconstructorsrecord component.- Returns:
- the value of the
constructorsrecord component
-